Skip to content

Instantly share code, notes, and snippets.

@jrissler
Created December 18, 2013 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrissler/8028562 to your computer and use it in GitHub Desktop.
Save jrissler/8028562 to your computer and use it in GitHub Desktop.
What would sandi do?
# our conditions would be an array of 5 true or false conditions
case our_conditions
when /TT.FF/
ClassOne.new(self, our_conditions)
return_value
when /FT.../
ClassTwo.new(self, our_conditions)
return_value
when /TT.TF/
ClassThree.new(self, our_conditions)
return_value
when /TT.TT/
ClassFour.new(self, our_conditions)
return_value
when /FF.F./
ClassFive.new(self, our_conditions)
return_value
when /TF.F./
ClassSix.new(self, our_conditions)
return_value
when /.F.T./
ClassSeven.new(self, our_conditions)
return_value
when /.F.TT/
ClassEight.new(self, our_conditions)
return_value
else
error = {:status => 404, :message_key => message_key, :message => message}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment