Class: Timezonedb::Client::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/timezonedb/client/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_hash) ⇒ Response

Returns a new instance of Response.



23
24
25
26
27
28
29
30
31
# File 'lib/timezonedb/client/response.rb', line 23

def initialize(response_hash)
  @message      = response_hash['message']
  @country_code = response_hash['countryCode']
  @zone_name    = response_hash['zoneName']
  @abbreviation = response_hash['abbreviation']
  @gmt_offset   = response_hash['gmtOffset']
  @dst          = response_hash['dst']
  @timestamp    = response_hash['timestamp']
end

Instance Attribute Details

#abbreviationObject (readonly)

Returns the value of attribute abbreviation.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def abbreviation
  @abbreviation
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def country_code
  @country_code
end

#dstObject (readonly)

Returns the value of attribute dst.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def dst
  @dst
end

#gmt_offsetObject (readonly)

Returns the value of attribute gmt_offset.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def gmt_offset
  @gmt_offset
end

#messageObject (readonly)

Returns the value of attribute message.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def status
  @status
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def timestamp
  @timestamp
end

#zone_nameObject (readonly)

Returns the value of attribute zone_name.



20
21
22
# File 'lib/timezonedb/client/response.rb', line 20

def zone_name
  @zone_name
end