Class: Timezone::Parser
- Inherits:
-
Object
- Object
- Timezone::Parser
- Defined in:
- lib/timezone/parser.rb
Constant Summary collapse
- LINE =
/\s*(.+)\s*=\s*(.+)\s*isdst=(\d+)\s*gmtoff=([\+\-]*\d+)/
- FORMAT =
'%a %b %e %H:%M:%S %Y %Z'
- ZONEINFO_DIR =
'/usr/share/zoneinfo'
Instance Attribute Summary collapse
-
#zoneinfo ⇒ Object
readonly
Returns the value of attribute zoneinfo.
Instance Method Summary collapse
-
#initialize(zoneinfo = ZONEINFO_DIR) ⇒ Parser
constructor
A new instance of Parser.
- #perform ⇒ Object
Constructor Details
#initialize(zoneinfo = ZONEINFO_DIR) ⇒ Parser
Returns a new instance of Parser.
12 13 14 |
# File 'lib/timezone/parser.rb', line 12 def initialize(zoneinfo = ZONEINFO_DIR) @zoneinfo = zoneinfo end |
Instance Attribute Details
#zoneinfo ⇒ Object (readonly)
Returns the value of attribute zoneinfo.
10 11 12 |
# File 'lib/timezone/parser.rb', line 10 def zoneinfo @zoneinfo end |
Instance Method Details
#perform ⇒ Object
16 17 18 19 20 21 |
# File 'lib/timezone/parser.rb', line 16 def perform Dir["#{zoneinfo}/right/**/*"].each do |file| next if File.directory?(file) parse(file) end end |