Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

best ruby cheat sheet

1.is_a? Integer # returns true
:1.is_a? Symbol # returns true
"1".is_a? String # returns true
[1,2,3].collect!() # does something to every element (overwrites original with ! mark)
.map() # is the same as .collect
1.2.floor # 1 # rounds a float (a number with a decimal) down to the nearest integer.
cube.call # implying that cube is a proc, call calls procs directly
Time.now # displays the actual time
Source by github.com #
 
PREVIOUS NEXT
Tagged: #ruby #cheat #sheet
ADD COMMENT
Topic
Name
2+7 =