Class: LibTAD::TADTime::TimeChange

Inherits:
Object
  • Object
show all
Defined in:
lib/types/time/time_change.rb

Overview

Information about a time change.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#newdstInteger (readonly)

New DST offset in seconds. Value will be null/empty if there is no DST for this location.

Returns:

  • (Integer)


7
8
9
# File 'lib/types/time/time_change.rb', line 7

def newdst
  @newdst
end

#newlocaltimeString (readonly)

Local time after transition, formatted as ISO 8601 time.

Example: 2011-03-27T03:00:00

Returns:

  • (String)

See Also:



37
38
39
# File 'lib/types/time/time_change.rb', line 37

def newlocaltime
  @newlocaltime
end

#newoffsetInteger (readonly)

New total offset to UTC in seconds.

Returns:

  • (Integer)


16
17
18
# File 'lib/types/time/time_change.rb', line 16

def newoffset
  @newoffset
end

#newzoneInteger (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.

Returns:

  • (Integer)


12
13
14
# File 'lib/types/time/time_change.rb', line 12

def newzone
  @newzone
end

#oldlocaltimeString (readonly)

Local time before transition, formatted as ISO 8601 time.

Example: 2011-03-27T02:00:00

Returns:

  • (String)

See Also:



30
31
32
# File 'lib/types/time/time_change.rb', line 30

def oldlocaltime
  @oldlocaltime
end

#utctimeString (readonly)

Time stamp of transition in UTC time, formatted as ISO 8601 time.

Example: 2011-03-27T01:00:00

Returns:

  • (String)

See Also:



23
24
25
# File 'lib/types/time/time_change.rb', line 23

def utctime
  @utctime
end