Class: LibTAD::TADTime::TADTimeZone
- Inherits:
-
Object
- Object
- LibTAD::TADTime::TADTimeZone
- Defined in:
- lib/types/time/timezone.rb
Overview
Timezone information.
Instance Attribute Summary collapse
-
#offset ⇒ String
readonly
The time zone offset (from UTC) in string representation.
-
#zoneabb ⇒ String
readonly
Abbreviated time zone name.
-
#zonedst ⇒ Integer
readonly
DST component of time zone offset in seconds.
-
#zonename ⇒ String
readonly
Full time zone name.
-
#zoneoffset ⇒ Integer
readonly
Basic time zone offset (without DST) in seconds.
-
#zonetotaloffset ⇒ Integer
readonly
Total offset from UTC in seconds.
Instance Method Summary collapse
-
#initialize(hash) ⇒ TADTimeZone
constructor
A new instance of TADTimeZone.
Constructor Details
#initialize(hash) ⇒ TADTimeZone
Returns a new instance of 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
#offset ⇒ String (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 |
#zoneabb ⇒ String (readonly)
Abbreviated time zone name.
Example: LHDT
15 16 17 |
# File 'lib/types/time/timezone.rb', line 15 def zoneabb @zoneabb end |
#zonedst ⇒ Integer (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 |
#zonename ⇒ String (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 |
#zoneoffset ⇒ Integer (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 |
#zonetotaloffset ⇒ Integer (readonly)
Total offset from UTC in seconds.
Example: 39600
39 40 41 |
# File 'lib/types/time/timezone.rb', line 39 def zonetotaloffset @zonetotaloffset end |