Class: GoogleCurrencyExchange

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#call_google_finance, #extract_exchanged_amount

Constructor Details

#initialize(amount, from, to) ⇒ GoogleCurrencyExchange

Returns a new instance of GoogleCurrencyExchange.



10
11
12
13
14
# File 'lib/google_currency_exchange.rb', line 10

def initialize(amount, from, to)
  @amount = amount
  @from = from
  @to = to
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



8
9
10
# File 'lib/google_currency_exchange.rb', line 8

def amount
  @amount
end

#fromObject

Returns the value of attribute from.



8
9
10
# File 'lib/google_currency_exchange.rb', line 8

def from
  @from
end

#toObject

Returns the value of attribute to.



8
9
10
# File 'lib/google_currency_exchange.rb', line 8

def to
  @to
end

Instance Method Details

#processObject



16
17
18
# File 'lib/google_currency_exchange.rb', line 16

def process
  call_google_finance(@amount, @from, @to)
end