Module: Timezone::Parser::Zone
- Defined in:
- lib/timezone/parser/zone/entry.rb,
lib/timezone/parser/zone.rb,
lib/timezone/parser/zone/until.rb,
lib/timezone/parser/zone/data_generator.rb
Overview
Responsible for parsing the UNTIL value of a TZData zone entry.
Defined Under Namespace
Modules: DataGenerator, Until Classes: Entry
Constant Summary collapse
- ENTRY =
Each entry follows this format. GMT-OFFSET RULES FORMAT [UNTIL]
/(\d+?:\d+?:*\d*?)\s+(.+?)\s([^\s]+)\s*(.*?)$/- HEADER =
The header entry also includes the Zone name. Zone ZONE-NAME GMT-OFFSET RULES FORMAT [UNTIL]
/Zone\s+(.+?)\s+/- @@zones =
Zones are stored in a hash of arrays that are referenced by name.
Hash.new{ |h, k| h[k] = [] }
Class Attribute Summary collapse
-
.last ⇒ Object
Returns the value of attribute last.
Class Method Summary collapse
Class Attribute Details
.last ⇒ Object
Returns the value of attribute last.
26 27 28 |
# File 'lib/timezone/parser/zone.rb', line 26 def last @last end |
Class Method Details
.data ⇒ Object
8 |
# File 'lib/timezone/parser/zone/data_generator.rb', line 8 def self.data ; DataGenerator.data ; end |
.generate(zones) ⇒ Object
6 |
# File 'lib/timezone/parser/zone/data_generator.rb', line 6 def self.generate(zones) ; DataGenerator.generate(zones) ; end |
.parse(line) ⇒ Object
28 29 30 31 32 |
# File 'lib/timezone/parser/zone.rb', line 28 def self.parse(line) self.last = $~[1] if line.match(HEADER) @@zones[last] << Entry.new(last, *line.match(ENTRY)[1..-1]) end |
.zones ⇒ Object
22 |
# File 'lib/timezone/parser/zone.rb', line 22 def self.zones ; @@zones ; end |