Class: Latinum::ExchangeRate
- Inherits:
-
Object
- Object
- Latinum::ExchangeRate
- Defined in:
- lib/latinum/bank.rb
Overview
A basic exchange rate for a named resource.
Instance Attribute Summary collapse
-
#factor ⇒ Object
readonly
The rate of exchange.
-
#input ⇒ Object
readonly
The name of the input resource.
-
#output ⇒ Object
readonly
The name of the output resource.
Instance Method Summary collapse
-
#initialize(input, output, factor) ⇒ ExchangeRate
constructor
A new instance of ExchangeRate.
Constructor Details
#initialize(input, output, factor) ⇒ ExchangeRate
Returns a new instance of ExchangeRate.
31 32 33 34 35 |
# File 'lib/latinum/bank.rb', line 31 def initialize(input, output, factor) @input = input @output = output @factor = factor.to_d end |
Instance Attribute Details
#factor ⇒ Object (readonly)
The rate of exchange.
47 48 49 |
# File 'lib/latinum/bank.rb', line 47 def factor @factor end |
#input ⇒ Object (readonly)
The name of the input resource.
39 40 41 |
# File 'lib/latinum/bank.rb', line 39 def input @input end |
#output ⇒ Object (readonly)
The name of the output resource.
43 44 45 |
# File 'lib/latinum/bank.rb', line 43 def output @output end |