Class: OandaAPI::Resource::Labs::SpreadHistory
- Inherits:
-
OandaAPI::ResourceBase
- Object
- OandaAPI::ResourceBase
- OandaAPI::Resource::Labs::SpreadHistory
- Defined in:
- lib/oanda_api/resource/labs/spread_history.rb
Overview
Spread value object. See the Oanda Developer Guide for information about Spreads.
Defined Under Namespace
Classes: Tuple
Constant Summary
Constants inherited from OandaAPI::ResourceBase
OandaAPI::ResourceBase::NOT_PLURALIZED
Instance Attribute Summary collapse
-
#avg ⇒ Object
(also: #averages)
Returns the value of attribute avg.
-
#max ⇒ Object
(also: #maximums)
Returns the value of attribute max.
-
#min ⇒ Object
(also: #minimums)
Returns the value of attribute min.
Attributes inherited from OandaAPI::ResourceBase
Instance Method Summary collapse
- #averages=(array = []) ⇒ Object
-
#initialize(attributes = {}) ⇒ SpreadHistory
constructor
A new instance of SpreadHistory.
- #maximums=(array = []) ⇒ Object
- #minimums=(array = []) ⇒ Object
Methods inherited from OandaAPI::ResourceBase
class_from_symbol, labs_resource?, pluralize, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ SpreadHistory
Returns a new instance of SpreadHistory.
16 17 18 19 20 21 22 |
# File 'lib/oanda_api/resource/labs/spread_history.rb', line 16 def initialize(attributes = {}) attribs = attributes.dup self.averages = attribs.delete(:avg) || [] self.maximums = attribs.delete(:max) || [] self.minimums = attribs.delete(:min) || [] super attribs end |
Instance Attribute Details
#avg ⇒ Object Also known as: averages
Returns the value of attribute avg.
8 9 10 |
# File 'lib/oanda_api/resource/labs/spread_history.rb', line 8 def avg @avg end |
#max ⇒ Object Also known as: maximums
Returns the value of attribute max.
8 9 10 |
# File 'lib/oanda_api/resource/labs/spread_history.rb', line 8 def max @max end |
#min ⇒ Object Also known as: minimums
Returns the value of attribute min.
8 9 10 |
# File 'lib/oanda_api/resource/labs/spread_history.rb', line 8 def min @min end |
Instance Method Details
#averages=(array = []) ⇒ Object
24 25 26 27 |
# File 'lib/oanda_api/resource/labs/spread_history.rb', line 24 def averages=(array=[]) @avg = [] array.each { |elements| @avg << Tuple.new(*elements) } end |