Class: Timezone::Parser
- Inherits:
-
Object
- Object
- Timezone::Parser
- Defined in:
- lib/timezone/parser.rb
Defined Under Namespace
Classes: Line
Constant Summary collapse
- LINE =
/\s*(.+)\s*=\s*(.+)\s*isdst=(\d+)\s*gmtoff=([\+\-]*\d+)/
- 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.
11 12 13 |
# File 'lib/timezone/parser.rb', line 11 def initialize(zoneinfo = ZONEINFO_DIR) @zoneinfo = zoneinfo end |
Instance Attribute Details
#zoneinfo ⇒ Object (readonly)
Returns the value of attribute zoneinfo.
9 10 11 |
# File 'lib/timezone/parser.rb', line 9 def zoneinfo @zoneinfo end |
Instance Method Details
#perform ⇒ Object
15 16 17 18 19 20 |
# File 'lib/timezone/parser.rb', line 15 def perform Dir["#{zoneinfo}/right/**/*"].each do |file| next if File.directory?(file) parse(file) end end |