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