Skip to content

Instantly share code, notes, and snippets.

@vanderhoop
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save vanderhoop/0465dafd9e81ccf91cd0 to your computer and use it in GitHub Desktop.

Select an option

Save vanderhoop/0465dafd9e81ccf91cd0 to your computer and use it in GitHub Desktop.

Everything Returns Something

Learning Objective

  • to begin thinking of every object and operation in Ruby as having a return value

Directions

The lines below all return a value. To identify that value, copy and paste each of the following lines into pry and press enter. Examine the return value.

"Miranda Hildensplat"

54 / 2

nil

nil.object_id

90.0 / 40.0

"we will rock you.".upcase

"4".to_i

:dan_brown

"suoicodilaipxecitsiligarfilacrepus".reverse

"Where have all the cowboys gone?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment