Ruby Review

Back to Curriculum Index


  • Use the interface comfortably
  • Identify different between puts and print
  • Explore, then explain what String methods can help us do

Review what we know, puts vs. print

Using the we just forked, complete the activity that follows:

Try It: Exploring puts vs. print

Read the Ruby code in the and predict what will happen when it is run. With the concepts and vocabulary you learned in the prework, try to explain why! Be ready to share out.

Now, run the

Last, change both instances of puts to print. Observe the change in output. What does that tell you about the job that each command has?


  • print and puts are both classified as commands that are built into the Ruby language.
  • print will print each value it is instructed to. print statments written on different lines of code will not appear on different lines in the output.
  • puts will also print each value it is instructed to; but it will create line breaks between each puts statement.

String Methods

In the spirit of exploring to learn, we aren’t gong to tell what what exactly the code below does - not yet.

friend = "osCAr"
puts "Hello, #{first_name}!"
puts "Hello, #{first_name.capitalize}!"

Try It: Exploring Methods

Read the code above and predict what will happen when it is run. Try to explain why.

Now, type or copy and paste the code into your and run it - does that verify or falsify your prediction?

Then, change capitalize to upcase, then downcase, then reverse. Re-run the code each time to change it, and observe the output.


  • Ruby provides a variety of methods that can be used specifically on Strings - we can think of them as actions!
  • A Ruby developer doesn't need to memeorize every method that is available; some will be used regularly but others won't. For this reason, resources like are heavily relied upon by developers!

Next: User Input