Class: MoneyConverter
Instance Method Summary collapse
- #exchange ⇒ Object
-
#initialize(from_currency, to_currency, amount) ⇒ MoneyConverter
constructor
A new instance of MoneyConverter.
Constructor Details
#initialize(from_currency, to_currency, amount) ⇒ MoneyConverter
Returns a new instance of MoneyConverter.
8 9 10 11 12 |
# File 'lib/money_converter.rb', line 8 def initialize(from_currency, to_currency, amount) @from_currency = from_currency @to_currency = to_currency @amount = amount end |
Instance Method Details
#exchange ⇒ Object
14 15 16 |
# File 'lib/money_converter.rb', line 14 def exchange api_request(@amount, @from_currency, @to_currency) end |