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.
15 16 17 18 19 |
# File 'lib/latinum/bank.rb', line 15 def initialize(input, output, factor) @input = input @output = output @factor = factor.to_d end |
Instance Attribute Details
#factor ⇒ Object (readonly)
The rate of exchange.
31 32 33 |
# File 'lib/latinum/bank.rb', line 31 def factor @factor end |
#input ⇒ Object (readonly)
The name of the input resource.
23 24 25 |
# File 'lib/latinum/bank.rb', line 23 def input @input end |
#output ⇒ Object (readonly)
The name of the output resource.
27 28 29 |
# File 'lib/latinum/bank.rb', line 27 def output @output end |