Module: Timezone::Loader

Defined in:
lib/timezone/loader.rb

Constant Summary collapse

ZONE_FILE_PATH =
File.expand_path(File.dirname(__FILE__)+'/../../data')
SOURCE_BIT =
0

Class Method Summary collapse

Class Method Details

.load(zone) ⇒ Object



9
10
11
12
# File 'lib/timezone/loader.rb', line 9

def load(zone)
  @rules ||= {}
  @rules[zone] ||= parse_zone_data(get_zone_data(zone))
end

.namesObject



14
15
16
17
18
19
# File 'lib/timezone/loader.rb', line 14

def names
  @@names ||= Dir[File.join(ZONE_FILE_PATH, "**/*")].map{ |file|
    next if File.directory?(file)
    file.gsub("#{ZONE_FILE_PATH}/", '')
  }.compact
end