Class: Fugle::Intraday::Quote::Price 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) ⇒ 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.

Since:

  • 0.1.0



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

#highObject (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



79
80
81
# File 'lib/fugle/intraday/quote.rb', line 79

def high
  @high
end

#lowObject (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



79
80
81
# File 'lib/fugle/intraday/quote.rb', line 79

def low
  @low
end

#openObject (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



79
80
81
# File 'lib/fugle/intraday/quote.rb', line 79

def open
  @open
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



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

Returns:

  • (String)

    the json string

Since:

  • 0.1.0



109
110
111
# File 'lib/fugle/intraday/quote.rb', line 109

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