Basic Usage
suggest changeIRB means “Interactive Ruby Shell”. It lets us execute Ruby expressions from standard input.
To start, type irb into your shell. You can write anything in Ruby, from simple expressions:
$ irb
2.1.4 :001 > 2+2
=> 4
to complex cases like methods:
2.1.4 :001> def method
2.1.4 :002?> puts "Hello World"
2.1.4 :003?> end
=> :method
2.1.4 :004 > method
Hello World
=> nil
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents