Skip to content

Instantly share code, notes, and snippets.

@semmons99
Created April 19, 2011 13:37
Show Gist options
  • Save semmons99/927730 to your computer and use it in GitHub Desktop.
Save semmons99/927730 to your computer and use it in GitHub Desktop.
class Rates
def initialize(rates_xml)
@rates = {}
@rates_xml = rates_xml
end
def rate(from, to)
@rates["#{from}:#{to}"] ||= derive_rate(from, to)
end
private
def derive_rate(from, to)
#...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment