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?

  • Exponentiation in Ruby

  • Returning nil when a method’s operation is not possible

  • More recursion and exit conditions

  • Modules and Inheritance

  • Hash.merge

  • Class Variables

  • Array.detect (“find first”)

  • Subtracting Hashes

  • Exiting the entire script with fail

  • begin—rescue—end

  • Downloading with open-uri

  • Parsing XML files with regular expressions

  • Writing to YAML files with YAML.dump

  • Reading from YAML files with YAML.load

It’s almost as if this chapter weren’t really about numbers—we covered a large amount of generically useful information, especially Modules, Class Variables, and external data storage and retrieval using either XML or YAML (or both). We’ve done a bit of functional programming already in the last two chapters, but ...

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