Class: Fugle::Intraday::Quote::Order Private

Inherits:
Object
  • Object
show all
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.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Since:

  • 0.1.0



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_asksObject (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.

Since:

  • 0.1.0



119
120
121
# File 'lib/fugle/intraday/quote.rb', line 119

def best_asks
  @best_asks
end

#best_bidsObject (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.

Since:

  • 0.1.0



119
120
121
# File 'lib/fugle/intraday/quote.rb', line 119

def best_bids
  @best_bids
end

#update_atObject (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.

Since:

  • 0.1.0



119
120
121
# File 'lib/fugle/intraday/quote.rb', line 119

def update_at
  @update_at
end

Instance Method Details

#to_hHash

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

Returns:

  • (Hash)

    the response as hash

Since:

  • 0.1.0



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

Returns:

  • (String)

    the json string

Since:

  • 0.1.0



149
150
151
# File 'lib/fugle/intraday/quote.rb', line 149

def to_json(*args)
  to_h.to_json(*args)
end