O'Reilly logo

Ruby by Example by Kevin C. Baird

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter Recap

What was new in this chapter?

  • Dates

  • Constants versus magic numbers

  • Expressions with the || operator

  • ENV[‘HOME’]

  • External file access, both reading and writing, using File.new

  • Splitting Strings into Arrays

  • Printing with puts

  • Generating (pseudo-)random numbers

  • Running Ruby programs at the command line

  • Defining and instantiating new Classes

  • Instance variables: @i_am_an_instance_variable

  • Ruby method naming conventions: predicate?, destructive!

  • Introduction to RDoc

  • Expression interpolation within Strings: “#{interpolate_me}”

  • Ternary operator: (expression ? if_true : if_false)

  • Access control

  • Open classes

  • Using ARGV

  • Using the each method with blocks

  • The system method

That’s a great deal of non-trivial information. If you’re relatively new to programming, have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required