Class: LibTAD::TADTime::TimeChange
- Inherits:
-
Object
- Object
- LibTAD::TADTime::TimeChange
- Defined in:
- lib/types/time/time_change.rb
Overview
Information about a time change.
Instance Attribute Summary collapse
-
#newdst ⇒ Integer
readonly
New DST offset in seconds.
-
#newlocaltime ⇒ String
readonly
Local time after transition, formatted as ISO 8601 time.
-
#newoffset ⇒ Integer
readonly
New total offset to UTC in seconds.
-
#newzone ⇒ Integer
readonly
New time zone offset to UTC in seconds if there is a time zone change for this place.
-
#oldlocaltime ⇒ String
readonly
Local time before transition, formatted as ISO 8601 time.
-
#utctime ⇒ String
readonly
Time stamp of transition in UTC time, formatted as ISO 8601 time.
Instance Method Summary collapse
-
#initialize(hash) ⇒ TimeChange
constructor
A new instance of TimeChange.
Constructor Details
#initialize(hash) ⇒ TimeChange
Returns a new instance of TimeChange.
39 40 41 42 43 44 45 46 |
# File 'lib/types/time/time_change.rb', line 39 def initialize(hash) @newdst = hash.fetch('newdst', nil) @newzone = hash.fetch('newzone', nil) @newoffset = hash.fetch('newoffset', nil) @utctime = hash.fetch('utctime', nil) @oldlocaltime = hash.fetch('oldlocaltime', nil) @newlocaltime = hash.fetch('newlocaltime', nil) end |
Instance Attribute Details
#newdst ⇒ Integer (readonly)
New DST offset in seconds. Value will be null/empty if there is no DST for this location.
7 8 9 |
# File 'lib/types/time/time_change.rb', line 7 def newdst @newdst end |
#newlocaltime ⇒ String (readonly)
Local time after transition, formatted as ISO 8601 time.
Example: 2011-03-27T03:00:00
37 38 39 |
# File 'lib/types/time/time_change.rb', line 37 def newlocaltime @newlocaltime end |
#newoffset ⇒ Integer (readonly)
New total offset to UTC in seconds.
16 17 18 |
# File 'lib/types/time/time_change.rb', line 16 def newoffset @newoffset end |
#newzone ⇒ Integer (readonly)
New time zone offset to UTC in seconds if there is a time zone change for this place. Otherwise the value will be null/empty. Time zones changes happen only very rarely, so the field will be null/empty on most occasions.
12 13 14 |
# File 'lib/types/time/time_change.rb', line 12 def newzone @newzone end |
#oldlocaltime ⇒ String (readonly)
Local time before transition, formatted as ISO 8601 time.
Example: 2011-03-27T02:00:00
30 31 32 |
# File 'lib/types/time/time_change.rb', line 30 def oldlocaltime @oldlocaltime end |
#utctime ⇒ String (readonly)
Time stamp of transition in UTC time, formatted as ISO 8601 time.
Example: 2011-03-27T01:00:00
23 24 25 |
# File 'lib/types/time/time_change.rb', line 23 def utctime @utctime end |