Class: Trader::CompoundConverter
- Defined in:
- lib/trade-o-matic/converters/compound_converter.rb
Instance Attribute Summary collapse
-
#converters ⇒ Object
Returns the value of attribute converters.
Instance Method Summary collapse
-
#initialize(_converters) ⇒ CompoundConverter
constructor
A new instance of CompoundConverter.
- #rate ⇒ Object
Constructor Details
#initialize(_converters) ⇒ CompoundConverter
Returns a new instance of CompoundConverter.
5 6 7 |
# File 'lib/trade-o-matic/converters/compound_converter.rb', line 5 def initialize(_converters) @converters = _converters end |
Instance Attribute Details
#converters ⇒ Object
Returns the value of attribute converters.
3 4 5 |
# File 'lib/trade-o-matic/converters/compound_converter.rb', line 3 def converters @converters end |
Instance Method Details
#rate ⇒ Object
9 10 11 |
# File 'lib/trade-o-matic/converters/compound_converter.rb', line 9 def rate converters.inject(1.0) { |r, c| c.rate * r } end |