Class: Fugle::Intraday::Quote::Price Private
- Inherits:
-
Object
- Object
- Fugle::Intraday::Quote::Price
- Defined in:
- lib/fugle/intraday/quote.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #high ⇒ Object readonly private
- #low ⇒ Object readonly private
- #open ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(data) ⇒ Price
constructor
private
A new instance of Price.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
Constructor Details
#initialize(data) ⇒ Price
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Price.
83 84 85 86 87 |
# File 'lib/fugle/intraday/quote.rb', line 83 def initialize(data) @high = Trade.new(data['priceHigh']) @low = Trade.new(data['priceLow']) @open = Trade.new(data['priceOpen']) end |
Instance Attribute Details
#high ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
79 80 81 |
# File 'lib/fugle/intraday/quote.rb', line 79 def high @high end |
#low ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
79 80 81 |
# File 'lib/fugle/intraday/quote.rb', line 79 def low @low end |
#open ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
79 80 81 |
# File 'lib/fugle/intraday/quote.rb', line 79 def open @open end |
Instance Method Details
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert to Hash
95 96 97 98 99 100 101 |
# File 'lib/fugle/intraday/quote.rb', line 95 def to_h { high: @high, low: @low, open: @open } end |
#to_json(*args) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert to JSON
109 110 111 |
# File 'lib/fugle/intraday/quote.rb', line 109 def to_json(*args) to_h.to_json(*args) end |