Class: Latinum::ExchangeRate

Inherits:
Object
  • Object
show all
Defined in:
lib/latinum/bank.rb

Overview

A basic exchange rate for a named resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#factorObject (readonly)

The rate of exchange.



31
32
33
# File 'lib/latinum/bank.rb', line 31

def factor
  @factor
end

#inputObject (readonly)

The name of the input resource.



23
24
25
# File 'lib/latinum/bank.rb', line 23

def input
  @input
end

#outputObject (readonly)

The name of the output resource.



27
28
29
# File 'lib/latinum/bank.rb', line 27

def output
  @output
end