The simplest and most frequently used example in any programming language is the "Hello World" application. Its purpose is to print a simple message to the screen, usually "Hello, world." This is achieved in Ruby with the puts or "put string" function. The puts function will write to the screen any information it is given, including the information stored in any variables it is given.
In the first statement of this program, the information "Hello there" is assigned to the variable called message. In the second statement, the variable called message is passed to the function puts.
"Passing" a variable to a function is another way of saying you're giving a copy of the information stored in the variable to the function for use. The puts function is given the message "Hello there" which was stored in the variable called message. The puts function will then take this message and write it to the screen.
irb(main):001:0> message = "Hello there" => "Hello there" irb(main):002:0> puts(message) Hello there => nil