Class: IGMarkets::Instrument::OpeningHours
- Defined in:
- lib/ig_markets/instrument.rb
Overview
Contains details on the opening hours for an instrument. Returned by #opening_hours.
Instance Attribute Summary
Attributes inherited from Model
Class Method Summary collapse
-
.adjusted_api_attributes(attributes) ⇒ Hash
This method is used by DealingPlatform#instantiate_models to work around a vagary in the IG API where there is a seemingly unnecessary hash for the :opening_hours value that contains a single ‘:market_times` key which is what holds the actual opening hours data.
Instance Method Summary collapse
-
#close_time ⇒ Object
The close_time attribute.
-
#open_time ⇒ Object
The open_time attribute.
Methods inherited from Model
#==, allowed_values, attribute, attribute_type, attribute_value_allowed?, defined_attribute_names, deprecated_attribute, #initialize, #initialize_copy, #inspect, #to_h, valid_attribute?
Constructor Details
This class inherits a constructor from IGMarkets::Model
Class Method Details
.adjusted_api_attributes(attributes) ⇒ Hash
This method is used by DealingPlatform#instantiate_models to work around a vagary in the IG API where there is a seemingly unnecessary hash for the :opening_hours value that contains a single ‘:market_times` key which is what holds the actual opening hours data.
42 43 44 |
# File 'lib/ig_markets/instrument.rb', line 42 def self.adjusted_api_attributes(attributes) attributes.keys == [:market_times] ? attributes[:market_times] : attributes end |
Instance Method Details
#close_time ⇒ Object
The close_time attribute.
30 |
# File 'lib/ig_markets/instrument.rb', line 30 attribute :close_time |
#open_time ⇒ Object
The open_time attribute.
31 |
# File 'lib/ig_markets/instrument.rb', line 31 attribute :open_time |