Skip to content

Instantly share code, notes, and snippets.

@neilmarion
Created February 19, 2014 16:10
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 neilmarion/9095255 to your computer and use it in GitHub Desktop.
Save neilmarion/9095255 to your computer and use it in GitHub Desktop.
metaprogramming
def calculate_till
self.cash_in_till = type.nil? ? cash_on_hand :
send("calculate_#{type.gsub(/-/,"_")}")
calculated_value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment