Class: CoinSync::Config::ValueEstimationOptions
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- CoinSync::Config::ValueEstimationOptions
- Defined in:
- lib/coinsync/config.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ ValueEstimationOptions
constructor
A new instance of ValueEstimationOptions.
- #price_loader ⇒ Object
Constructor Details
#initialize(options) ⇒ ValueEstimationOptions
Returns a new instance of ValueEstimationOptions.
124 125 126 127 128 129 130 131 132 |
# File 'lib/coinsync/config.rb', line 124 def initialize() super if ['using'] self.price_loader_name = ['using'].to_sym else raise "'value_estimation' requires a 'using' field with a name of a price loader" end end |
Instance Method Details
#price_loader ⇒ Object
134 135 136 137 138 139 140 141 142 |
# File 'lib/coinsync/config.rb', line 134 def price_loader price_loader_class = PriceLoaders.registered[price_loader_name] if price_loader_class price_loader_class.new(self) else raise "Unknown price loader: #{price_loader_name}" end end |