Class: Barometer::Data::Zone
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Barometer::Data::Zone
- Defined in:
- lib/barometer/data/zone.rb
Instance Method Summary collapse
-
#initialize(zone) ⇒ Zone
constructor
A new instance of Zone.
Constructor Details
#initialize(zone) ⇒ Zone
Returns a new instance of Zone.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/barometer/data/zone.rb', line 7 def initialize(zone) zone = if ZoneFull.detect?(zone) ZoneFull.new(zone) elsif ZoneOffset.detect?(zone) ZoneOffset.new(zone) elsif ZoneCode.detect?(zone) ZoneCode.new(zone) else raise(ArgumentError, "invalid time zone") end super(zone) end |