The first thing to know about Ruby is that it’s easy to use. To prove this, let’s look at the code of the traditional “Hello world” program:
puts 'hello world'
That’s it in its entirety. The program contains one method,
puts, and one string, “hello world.” It doesn’t have any headers or class definitions, and it doesn’t have any import sections or “main” functions. This really is as simple as it gets. Load the code, 1helloworld.rb, and try it.
Having “put” a string to the output (here, a command window), the obvious next step is to “get” a string. As you might ...