Created
June 29, 2011 21:09
-
-
Save mharper/1054978 to your computer and use it in GitHub Desktop.
Even in Ruby, Bird is The Word
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
ruby-1.9.2-p180 :001 > class String | |
ruby-1.9.2-p180 :002?> def is_the_word? | |
ruby-1.9.2-p180 :003?> self.casecmp("bird") == 0 | |
ruby-1.9.2-p180 :004?> end | |
ruby-1.9.2-p180 :005?> end | |
=> nil | |
ruby-1.9.2-p180 :006 > "Bird".is_the_word? | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment