Created
January 21, 2014 14:00
-
-
Save jeremywrowe/8540593 to your computer and use it in GitHub Desktop.
This file contains 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
require 'active_support/core_ext/string/inquiry.rb' | |
def speak_like_a(val) | |
is = val.inquiry | |
if is.chicken? | |
puts "bagaaawk" | |
elsif is.pig? | |
puts "oink" | |
else | |
puts "sorry don't know what tongue that speak in" | |
end | |
end | |
speak_like_a "chicken" # => "bagaaawk" | |
speak_like_a "pig" # => "oink" | |
speak_like_a "wombat" # => "sorry don't know what tongue that speaks in" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment