Class: Fugle::Information Private

Inherits:
Object
  • Object
show all
Defined in:
lib/fugle/information.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 Information

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Information

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

Since:

  • 0.1.0



17
18
19
20
21
22
23
24
# File 'lib/fugle/information.rb', line 17

def initialize(attributes = {})
  @symbol = attributes['symbolId']
  @mode = attributes['mode']
  @timezone = attributes['timeZone']
  @country_code = attributes['countryCode']
  @updated_at = DateTime.parse(attributes['lastUpdatedAt'])
  @date = Date.parse(attributes['date'])
end

Instance Attribute Details

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



13
14
15
# File 'lib/fugle/information.rb', line 13

def country_code
  @country_code
end

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



13
14
15
# File 'lib/fugle/information.rb', line 13

def date
  @date
end

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



13
14
15
# File 'lib/fugle/information.rb', line 13

def mode
  @mode
end

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



13
14
15
# File 'lib/fugle/information.rb', line 13

def symbol
  @symbol
end

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



13
14
15
# File 'lib/fugle/information.rb', line 13

def timezone
  @timezone
end

#updated_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



13
14
15
# File 'lib/fugle/information.rb', line 13

def updated_at
  @updated_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



32
33
34
35
36
37
38
39
40
41
# File 'lib/fugle/information.rb', line 32

def to_h
  {
    symbol: @symbol,
    mode: @mode,
    timezone: @timezone,
    country_code: @country_code,
    date: @date,
    updated_at: @updated_at
  }
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



49
50
51
# File 'lib/fugle/information.rb', line 49

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