Class: GoogleTimezone::Result
- Inherits:
-
Object
- Object
- GoogleTimezone::Result
- Defined in:
- lib/google_timezone/result.rb
Instance Method Summary collapse
- #dst_offset ⇒ Object
-
#initialize(result) ⇒ Result
constructor
A new instance of Result.
- #raw ⇒ Object
- #raw_offset ⇒ Object
- #result ⇒ Object
- #success? ⇒ Boolean
- #time_zone_id ⇒ Object
- #time_zone_name ⇒ Object
Constructor Details
#initialize(result) ⇒ Result
4 5 6 |
# File 'lib/google_timezone/result.rb', line 4 def initialize(result) @result = result end |
Instance Method Details
#dst_offset ⇒ Object
16 17 18 |
# File 'lib/google_timezone/result.rb', line 16 def dst_offset @result.fetch('dstOffset',0) end |
#raw ⇒ Object
8 9 10 |
# File 'lib/google_timezone/result.rb', line 8 def raw @result end |
#raw_offset ⇒ Object
20 21 22 |
# File 'lib/google_timezone/result.rb', line 20 def raw_offset @result.fetch('rawOffset',0) end |
#result ⇒ Object
32 33 34 |
# File 'lib/google_timezone/result.rb', line 32 def result @result.fetch('result','') end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/google_timezone/result.rb', line 12 def success? @result['status'].eql?('OK') end |
#time_zone_id ⇒ Object
24 25 26 |
# File 'lib/google_timezone/result.rb', line 24 def time_zone_id @result.fetch('timeZoneId','') end |
#time_zone_name ⇒ Object
28 29 30 |
# File 'lib/google_timezone/result.rb', line 28 def time_zone_name @result.fetch('timeZoneName','') end |