lib/tzinfo/definitions/America/Barbados.rb in tzinfo-0.2.2 vs lib/tzinfo/definitions/America/Barbados.rb in tzinfo-0.3.0
- old
+ new
@@ -1,22 +1,29 @@
-require 'tzinfo/timezone'
+require 'tzinfo/timezone_definition'
+
module TZInfo
-module Definitions #:nodoc:
-module America #:nodoc:
-class Barbados < Timezone #:nodoc:
-setup
-set_identifier('America/Barbados')
-add_unbounded_start_period {TimezonePeriod.new(nil,DateTime.new0(Rational.new!(52353770377,21600),0,Date::ITALY),-14308,0,:LMT)}
-add_period(1924,1) {TimezonePeriod.new(DateTime.new0(Rational.new!(52353770377,21600),0,Date::ITALY),DateTime.new0(Rational.new!(52416885577,21600),0,Date::ITALY),-14308,0,:BMT)}
-add_period(1932,1) {TimezonePeriod.new(DateTime.new0(Rational.new!(52416885577,21600),0,Date::ITALY),234943200,-14400,0,:AST)}
-add_period(1977,6) {TimezonePeriod.new(234943200,244616400,-14400,3600,:ADT)}
-add_period(1977,10) {TimezonePeriod.new(244616400,261554400,-14400,0,:AST)}
-add_period(1978,4) {TimezonePeriod.new(261554400,276066000,-14400,3600,:ADT)}
-add_period(1978,10) {TimezonePeriod.new(276066000,293004000,-14400,0,:AST)}
-add_period(1979,4) {TimezonePeriod.new(293004000,307515600,-14400,3600,:ADT)}
-add_period(1979,9) {TimezonePeriod.new(307515600,325058400,-14400,0,:AST)}
-add_period(1980,4) {TimezonePeriod.new(325058400,338706000,-14400,3600,:ADT)}
-add_period(1980,9) {TimezonePeriod.new(338706000,nil,-14400,0,:AST)}
-end
-end
-end
+ module Definitions
+ module America
+ module Barbados
+ include TimezoneDefinition
+
+ timezone 'America/Barbados' do |tz|
+ tz.offset :o0, -14308, 0, :LMT
+ tz.offset :o1, -14308, 0, :BMT
+ tz.offset :o2, -14400, 0, :AST
+ tz.offset :o3, -14400, 3600, :ADT
+
+ tz.transition 1924, 1, :o1, 52353770377, 21600
+ tz.transition 1932, 1, :o2, 52416885577, 21600
+ tz.transition 1977, 6, :o3, 234943200
+ tz.transition 1977, 10, :o2, 244616400
+ tz.transition 1978, 4, :o3, 261554400
+ tz.transition 1978, 10, :o2, 276066000
+ tz.transition 1979, 4, :o3, 293004000
+ tz.transition 1979, 9, :o2, 307515600
+ tz.transition 1980, 4, :o3, 325058400
+ tz.transition 1980, 9, :o2, 338706000
+ end
+ end
+ end
+ end
end