Class: Fugle::Intraday::Quote::Order Private
- Inherits:
-
Object
- Object
- Fugle::Intraday::Quote::Order
- 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
- #best_asks ⇒ Object readonly private
- #best_bids ⇒ Object readonly private
- #update_at ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(data) ⇒ Order
constructor
private
A new instance of Order.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
Constructor Details
#initialize(data) ⇒ Order
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 Order.
123 124 125 126 127 |
# File 'lib/fugle/intraday/quote.rb', line 123 def initialize(data) @updated_at = DateTime.parse(data['at']) @best_bids = data['bestBids'].map { |item| Trade.new(item) } @best_asks = data['bestAsks'].map { |item| Trade.new(item) } end |
Instance Attribute Details
#best_asks ⇒ 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.
119 120 121 |
# File 'lib/fugle/intraday/quote.rb', line 119 def best_asks @best_asks end |
#best_bids ⇒ 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.
119 120 121 |
# File 'lib/fugle/intraday/quote.rb', line 119 def best_bids @best_bids end |
#update_at ⇒ 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.
119 120 121 |
# File 'lib/fugle/intraday/quote.rb', line 119 def update_at @update_at 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
135 136 137 138 139 140 141 |
# File 'lib/fugle/intraday/quote.rb', line 135 def to_h { updated_at: @updated_at, best_bids: @best_bids, best_asks: @best_asks } 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
149 150 151 |
# File 'lib/fugle/intraday/quote.rb', line 149 def to_json(*args) to_h.to_json(*args) end |