Basics of Ruby
Start Ruby interpret
On terminal just type rib
ruby_docs $ irb 3.0.0 :001 > name = "This is the first string in Ruby" => "This is the first string in Ruby" 3.0.0 :002 > name.length => 32 3.0.0 :003 >
Introduction to Objects
Everything is an object
self
3.even?
1.next.next
self.methods self.methods.sort "This is string".methods.sort
More Objects and Methods
1.minutes 1.methods.sort
['rock','paper','scissors'].index('paper')
2.between?(1,3)
4.+(3) 1+2 # this is same as 1.+(2)
words = ["foo", "bar", "baz"] words[1]
words = ["foo", "bar", "baz"] words.[](1)