Module: Timezone::Parser::Zone::DataGenerator
- Defined in:
- lib/timezone/parser/zone/data_generator.rb
Overview
TODO [panthomakos] This needs refactoring.
Constant Summary collapse
- @@data =
Hash.new{ |h,k| h[k] = [] }
Class Method Summary collapse
Class Method Details
.data ⇒ Object
13 |
# File 'lib/timezone/parser/zone/data_generator.rb', line 13 def self.data ; @@data ; end |
.generate(zone) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/timezone/parser/zone/data_generator.rb', line 16 def generate(zone) zones = Timezone::Parser.zones[zone].to_a return if zones.empty? @@data[zone] = zones .each_cons(2) .inject(update(zones.first)) do |set, (previous, zone)| update(zone, set, previous && previous.end_date) end end |