..
(two dots) operator and the ...
(three dots) operator. Gee, how could anybody *possibly* get those confused.Fixnum
. You use the method to_i
convert to a Fixnum
(which is a descendant of Integer
)<<
operator is one of the options for string concatenation (along with +
, the .concat
method, or just putting two strings next to each other)(1..25) === 14
is not the same as 14 === (1..25)
.infinite?
method returns one of nil
, 1
or -1
Math::PI
is mutable.elem[index]
or as elem.at(index)
. Or if you have a string variable "blat", both blat.length
and blat.size
do the same thing. Why? What benefit is this?a = Array.new 12
rather than the far more readable a = Array.new(12)
return
statement, but it is not required.class Hello
def say_hi
puts "Hi!"
end
end
class Hello
def boo
puts "Boo!"
end
end
hi = Hello.new
hi.say_hi
hi.boo