Class: Fugle::Intraday::Meta Private

Inherits:
Object
  • Object
show all
Includes:
HTTP::API, Utils
Defined in:
lib/fugle/intraday/meta.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 Meta

Since:

  • 0.1.0

Defined Under Namespace

Classes: Price

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.

Since:

  • 0.1.0

%w[Index Terminated Suspended Warrant].freeze
PERMITS =

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.

Since:

  • 0.1.0

%w[DayBuySell DaySellBuy ShortMargin ShortLend].freeze

Constants included from HTTP::API

HTTP::API::ENDPOINT, HTTP::API::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HTTP::API

included

Constructor Details

#initialize(data) ⇒ Meta

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 Meta.

Since:

  • 0.1.0



28
29
30
31
32
33
34
35
36
# File 'lib/fugle/intraday/meta.rb', line 28

def initialize(data)
  load_boolean STATES, data, prefix: 'is'
  load_boolean PERMITS, data, prefix: 'can'

  @name = data['nameZhTw']
  @industry = data['industryZhTw']
  @type = data['typeZhTw']
  @price = Price.new(data)
end

Instance Attribute Details

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



19
20
21
# File 'lib/fugle/intraday/meta.rb', line 19

def industry
  @industry
end

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



19
20
21
# File 'lib/fugle/intraday/meta.rb', line 19

def name
  @name
end

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



19
20
21
# File 'lib/fugle/intraday/meta.rb', line 19

def price
  @price
end

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



19
20
21
# File 'lib/fugle/intraday/meta.rb', line 19

def type
  @type
end