Skip to content

Instantly share code, notes, and snippets.

@jmmastey
Last active August 29, 2015 14:05
Show Gist options
  • Save jmmastey/bbad16eeb470d6904188 to your computer and use it in GitHub Desktop.
Save jmmastey/bbad16eeb470d6904188 to your computer and use it in GitHub Desktop.
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