Last active
August 29, 2015 14:05
-
-
Save jmmastey/bbad16eeb470d6904188 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
def philosophize(thinker, thoughts) | |
thinker = Philosopher(thinker) | |
Array(thoughts).map do |thought| | |
thinker.think(thought) | |
end | |
end | |
def Philosopher(param) | |
return param if param.kind_of? Philosopher | |
return Philosopher.find(param) if param.kind_of? Integer | |
return param.to_philosopher if param.respond_to? :to_philosopher | |
raise ArgumentError | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment