Class: TestPack1::TimeZoneConfiguration
- Defined in:
- lib/test_pack_1/models/time_zone_configuration.rb
Overview
your system-configured time zone configuration.
Instance Attribute Summary collapse
-
#dst_timestamp_end ⇒ DateTime
The end of daylight savings time in the time zone.
-
#dst_timestamp_start ⇒ DateTime
The start of daylight savings time in the time zone.
-
#title ⇒ String
The title of the time zone.
-
#utc_offset ⇒ Float
The UTC offset for the time zone.
-
#utc_offset_dst ⇒ Float
The UTC offset for the time zone during daylight savings time.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(title = nil, utc_offset = nil, utc_offset_dst = nil, dst_timestamp_start = nil, dst_timestamp_end = nil) ⇒ TimeZoneConfiguration
constructor
A new instance of TimeZoneConfiguration.
Methods inherited from BaseModel
Constructor Details
#initialize(title = nil, utc_offset = nil, utc_offset_dst = nil, dst_timestamp_start = nil, dst_timestamp_end = nil) ⇒ TimeZoneConfiguration
Returns a new instance of TimeZoneConfiguration.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 43 def initialize(title = nil, utc_offset = nil, utc_offset_dst = nil, = nil, = nil) @title = title @utc_offset = utc_offset @utc_offset_dst = utc_offset_dst = = end |
Instance Attribute Details
#dst_timestamp_end ⇒ DateTime
The end of daylight savings time in the time zone. This timestamp is given in the UTC time zone.
30 31 32 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 30 def end |
#dst_timestamp_start ⇒ DateTime
The start of daylight savings time in the time zone. This timestamp is given in the UTC time zone.
25 26 27 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 25 def end |
#title ⇒ String
The title of the time zone.
12 13 14 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 12 def title @title end |
#utc_offset ⇒ Float
The UTC offset for the time zone.
16 17 18 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 16 def utc_offset @utc_offset end |
#utc_offset_dst ⇒ Float
The UTC offset for the time zone during daylight savings time.
20 21 22 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 20 def utc_offset_dst @utc_offset_dst end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. title = hash['title'] utc_offset = hash['utcOffset'] utc_offset_dst = hash['utcOffsetDst'] = APIHelper.rfc3339(hash['dstTimestampStart']) if hash['dstTimestampStart'] = APIHelper.rfc3339(hash['dstTimestampEnd']) if hash['dstTimestampEnd'] # Create object from extracted values. TimeZoneConfiguration.new(title, utc_offset, utc_offset_dst, , ) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/test_pack_1/models/time_zone_configuration.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['title'] = 'title' @_hash['utc_offset'] = 'utcOffset' @_hash['utc_offset_dst'] = 'utcOffsetDst' @_hash['dst_timestamp_start'] = 'dstTimestampStart' @_hash['dst_timestamp_end'] = 'dstTimestampEnd' @_hash end |