Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created August 22, 2011 15:57
Show Gist options
  • Save wjessop/1162741 to your computer and use it in GitHub Desktop.
Save wjessop/1162741 to your computer and use it in GitHub Desktop.
yes/no
ruby-1.9.2-p290 :001 > class Object
ruby-1.9.2-p290 :002?> def yes
ruby-1.9.2-p290 :003?> true
ruby-1.9.2-p290 :004?> end
ruby-1.9.2-p290 :005?>
ruby-1.9.2-p290 :006 > def no
ruby-1.9.2-p290 :007?> false
ruby-1.9.2-p290 :008?> end
ruby-1.9.2-p290 :009?> end
=> nil
ruby-1.9.2-p290 :010 > puts "hello" if yes
hello
=> nil
ruby-1.9.2-p290 :011 > puts "hello" if no
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment