Class: Fugle::Intraday::Quote Private
- Inherits:
-
Object
- Object
- Fugle::Intraday::Quote
- 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.
The Intraday Quote
Defined Under Namespace
Constant Summary collapse
- STATES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%w[Curbing Trial OpenDelayed Halting Closed].freeze
Constants included from HTTP::API
HTTP::API::ENDPOINT, HTTP::API::VERSION
Instance Attribute Summary collapse
- #orders ⇒ Object readonly private
- #price ⇒ Object readonly private
- #total ⇒ Object readonly private
- #trade ⇒ Object readonly private
- #trial ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(data) ⇒ Quote
constructor
private
A new instance of Quote.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
Methods included from HTTP::API
Constructor Details
#initialize(data) ⇒ Quote
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 Quote.
30 31 32 33 34 35 36 37 38 |
# File 'lib/fugle/intraday/quote.rb', line 30 def initialize(data) load_boolean STATES, data, prefix: 'is' @total = Trade.new(data['total']) @trial = Trade.new(data['trial']) @trade = Trade.new(data['trade']) @price = Price.new(data) @order = Order.new(data['order']) end |
Instance Attribute Details
#orders ⇒ 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.
22 23 24 |
# File 'lib/fugle/intraday/quote.rb', line 22 def orders @orders end |
#price ⇒ 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.
22 23 24 |
# File 'lib/fugle/intraday/quote.rb', line 22 def price @price end |
#total ⇒ 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.
22 23 24 |
# File 'lib/fugle/intraday/quote.rb', line 22 def total @total end |
#trade ⇒ 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.
22 23 24 |
# File 'lib/fugle/intraday/quote.rb', line 22 def trade @trade end |
#trial ⇒ 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.
22 23 24 |
# File 'lib/fugle/intraday/quote.rb', line 22 def trial @trial 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
54 55 56 57 58 59 60 61 62 |
# File 'lib/fugle/intraday/quote.rb', line 54 def to_h { total: @total, trial: @trial, trade: @trade, price: @price, order: @order } 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
70 71 72 |
# File 'lib/fugle/intraday/quote.rb', line 70 def to_json(*args) to_h.to_json(*args) end |