Class: Fugle::Information Private
- Inherits:
-
Object
- Object
- Fugle::Information
- 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
Instance Attribute Summary collapse
- #country_code ⇒ Object readonly private
- #date ⇒ Object readonly private
- #mode ⇒ Object readonly private
- #symbol ⇒ Object readonly private
- #timezone ⇒ Object readonly private
- #updated_at ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Information
constructor
private
A new instance of Information.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
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.
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_code ⇒ 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.
13 14 15 |
# File 'lib/fugle/information.rb', line 13 def country_code @country_code end |
#date ⇒ 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.
13 14 15 |
# File 'lib/fugle/information.rb', line 13 def date @date end |
#mode ⇒ 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.
13 14 15 |
# File 'lib/fugle/information.rb', line 13 def mode @mode end |
#symbol ⇒ 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.
13 14 15 |
# File 'lib/fugle/information.rb', line 13 def symbol @symbol end |
#timezone ⇒ 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.
13 14 15 |
# File 'lib/fugle/information.rb', line 13 def timezone @timezone end |
#updated_at ⇒ 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.
13 14 15 |
# File 'lib/fugle/information.rb', line 13 def updated_at @updated_at 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
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
49 50 51 |
# File 'lib/fugle/information.rb', line 49 def to_json(*args) to_h.to_json(*args) end |