Class: LibTAD::TADTime::TADTimeZone

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

Overview

Timezone information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ TADTimeZone



41
42
43
44
45
46
47
48
# File 'lib/types/time/timezone.rb', line 41

def initialize(hash)
  @offset = hash.fetch('offset', nil)
  @zoneabb = hash.fetch('zoneabb', nil)
  @zonename = hash.fetch('zonename', nil)
  @zoneoffset = hash.fetch('zoneoffset', nil)
  @zonedst = hash.fetch('zonedst', nil)
  @zonetotaloffset = hash.fetch('zonetotaloffset', nil)
end

Instance Attribute Details

#offsetString (readonly)

The time zone offset (from UTC) in string representation.

Example: +11:00



9
10
11
# File 'lib/types/time/timezone.rb', line 9

def offset
  @offset
end

#zoneabbString (readonly)

Abbreviated time zone name.

Example: LHDT



15
16
17
# File 'lib/types/time/timezone.rb', line 15

def zoneabb
  @zoneabb
end

#zonedstInteger (readonly)

DST component of time zone offset in seconds.

Example: 1800



33
34
35
# File 'lib/types/time/timezone.rb', line 33

def zonedst
  @zonedst
end

#zonenameString (readonly)

Full time zone name.

Example: Lord Howe Daylight Time



21
22
23
# File 'lib/types/time/timezone.rb', line 21

def zonename
  @zonename
end

#zoneoffsetInteger (readonly)

Basic time zone offset (without DST) in seconds.

Example: 37800



27
28
29
# File 'lib/types/time/timezone.rb', line 27

def zoneoffset
  @zoneoffset
end

#zonetotaloffsetInteger (readonly)

Total offset from UTC in seconds.

Example: 39600



39
40
41
# File 'lib/types/time/timezone.rb', line 39

def zonetotaloffset
  @zonetotaloffset
end