Class: MoneyConverter

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/money_converter.rb

Instance Method Summary collapse

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

#exchangeObject



14
15
16
# File 'lib/money_converter.rb', line 14

def exchange
	api_request(@amount, @from_currency, @to_currency)
end