class Trader::InverseConverter

Attributes

other[R]

Public Class Methods

new(_other) click to toggle source
# File lib/trade-o-matic/converters/inverse_converter.rb, line 5
def initialize(_other)
  @other = _other
end

Public Instance Methods

apply(_value, _invert=false) click to toggle source
# File lib/trade-o-matic/converters/inverse_converter.rb, line 14
def apply(_value, _invert=false)
  @other.apply(_value, !_invert)
end
current_rate() click to toggle source
# File lib/trade-o-matic/converters/inverse_converter.rb, line 9
def current_rate
  return nil if other.current_rate.nil?
  1.0 / other.current_rate
end