lib/tzinfo/definitions/Asia/Tehran.rb in tzinfo-0.2.2 vs lib/tzinfo/definitions/Asia/Tehran.rb in tzinfo-0.3.0
- old
+ new
@@ -1,52 +1,61 @@
-require 'tzinfo/timezone'
+require 'tzinfo/timezone_definition'
+
module TZInfo
-module Definitions #:nodoc:
-module Asia #:nodoc:
-class Tehran < Timezone #:nodoc:
-setup
-set_identifier('Asia/Tehran')
-add_unbounded_start_period {TimezonePeriod.new(nil,DateTime.new0(Rational.new!(26145324257,10800),0,Date::ITALY),12344,0,:LMT)}
-add_period(1915,12) {TimezonePeriod.new(DateTime.new0(Rational.new!(26145324257,10800),0,Date::ITALY),DateTime.new0(Rational.new!(26263670657,10800),0,Date::ITALY),12344,0,:TMT)}
-add_period(1945,12) {TimezonePeriod.new(DateTime.new0(Rational.new!(26263670657,10800),0,Date::ITALY),247177800,12600,0,:IRST)}
-add_period(1977,10) {TimezonePeriod.new(247177800,259272000,14400,0,:IRST)}
-add_period(1978,3) {TimezonePeriod.new(259272000,277758000,14400,3600,:IRDT)}
-add_period(1978,10) {TimezonePeriod.new(277758000,283982400,14400,0,:IRST)}
-add_period(1978,12) {TimezonePeriod.new(283982400,290809800,12600,0,:IRST)}
-add_period(1979,3) {TimezonePeriod.new(290809800,306531000,12600,3600,:IRDT)}
-add_period(1979,9) {TimezonePeriod.new(306531000,322432200,12600,0,:IRST)}
-add_period(1980,3) {TimezonePeriod.new(322432200,338499000,12600,3600,:IRDT)}
-add_period(1980,9) {TimezonePeriod.new(338499000,673216200,12600,0,:IRST)}
-add_period(1991,5) {TimezonePeriod.new(673216200,685481400,12600,3600,:IRDT)}
-add_period(1991,9) {TimezonePeriod.new(685481400,701209800,12600,0,:IRST)}
-add_period(1992,3) {TimezonePeriod.new(701209800,717103800,12600,3600,:IRDT)}
-add_period(1992,9) {TimezonePeriod.new(717103800,732745800,12600,0,:IRST)}
-add_period(1993,3) {TimezonePeriod.new(732745800,748639800,12600,3600,:IRDT)}
-add_period(1993,9) {TimezonePeriod.new(748639800,764281800,12600,0,:IRST)}
-add_period(1994,3) {TimezonePeriod.new(764281800,780175800,12600,3600,:IRDT)}
-add_period(1994,9) {TimezonePeriod.new(780175800,795817800,12600,0,:IRST)}
-add_period(1995,3) {TimezonePeriod.new(795817800,811711800,12600,3600,:IRDT)}
-add_period(1995,9) {TimezonePeriod.new(811711800,827353800,12600,0,:IRST)}
-add_period(1996,3) {TimezonePeriod.new(827353800,843247800,12600,3600,:IRDT)}
-add_period(1996,9) {TimezonePeriod.new(843247800,858976200,12600,0,:IRST)}
-add_period(1997,3) {TimezonePeriod.new(858976200,874870200,12600,3600,:IRDT)}
-add_period(1997,9) {TimezonePeriod.new(874870200,890512200,12600,0,:IRST)}
-add_period(1998,3) {TimezonePeriod.new(890512200,906406200,12600,3600,:IRDT)}
-add_period(1998,9) {TimezonePeriod.new(906406200,922048200,12600,0,:IRST)}
-add_period(1999,3) {TimezonePeriod.new(922048200,937942200,12600,3600,:IRDT)}
-add_period(1999,9) {TimezonePeriod.new(937942200,953584200,12600,0,:IRST)}
-add_period(2000,3) {TimezonePeriod.new(953584200,969478200,12600,3600,:IRDT)}
-add_period(2000,9) {TimezonePeriod.new(969478200,985206600,12600,0,:IRST)}
-add_period(2001,3) {TimezonePeriod.new(985206600,1001100600,12600,3600,:IRDT)}
-add_period(2001,9) {TimezonePeriod.new(1001100600,1016742600,12600,0,:IRST)}
-add_period(2002,3) {TimezonePeriod.new(1016742600,1032636600,12600,3600,:IRDT)}
-add_period(2002,9) {TimezonePeriod.new(1032636600,1048278600,12600,0,:IRST)}
-add_period(2003,3) {TimezonePeriod.new(1048278600,1064172600,12600,3600,:IRDT)}
-add_period(2003,9) {TimezonePeriod.new(1064172600,1079814600,12600,0,:IRST)}
-add_period(2004,3) {TimezonePeriod.new(1079814600,1095708600,12600,3600,:IRDT)}
-add_period(2004,9) {TimezonePeriod.new(1095708600,1111437000,12600,0,:IRST)}
-add_period(2005,3) {TimezonePeriod.new(1111437000,1127331000,12600,3600,:IRDT)}
-add_period(2005,9) {TimezonePeriod.new(1127331000,nil,12600,0,:IRST)}
-end
-end
-end
+ module Definitions
+ module Asia
+ module Tehran
+ include TimezoneDefinition
+
+ timezone 'Asia/Tehran' do |tz|
+ tz.offset :o0, 12344, 0, :LMT
+ tz.offset :o1, 12344, 0, :TMT
+ tz.offset :o2, 12600, 0, :IRST
+ tz.offset :o3, 14400, 0, :IRST
+ tz.offset :o4, 14400, 3600, :IRDT
+ tz.offset :o5, 12600, 3600, :IRDT
+
+ tz.transition 1915, 12, :o1, 26145324257, 10800
+ tz.transition 1945, 12, :o2, 26263670657, 10800
+ tz.transition 1977, 10, :o3, 247177800
+ tz.transition 1978, 3, :o4, 259272000
+ tz.transition 1978, 10, :o3, 277758000
+ tz.transition 1978, 12, :o2, 283982400
+ tz.transition 1979, 3, :o5, 290809800
+ tz.transition 1979, 9, :o2, 306531000
+ tz.transition 1980, 3, :o5, 322432200
+ tz.transition 1980, 9, :o2, 338499000
+ tz.transition 1991, 5, :o5, 673216200
+ tz.transition 1991, 9, :o2, 685481400
+ tz.transition 1992, 3, :o5, 701209800
+ tz.transition 1992, 9, :o2, 717103800
+ tz.transition 1993, 3, :o5, 732745800
+ tz.transition 1993, 9, :o2, 748639800
+ tz.transition 1994, 3, :o5, 764281800
+ tz.transition 1994, 9, :o2, 780175800
+ tz.transition 1995, 3, :o5, 795817800
+ tz.transition 1995, 9, :o2, 811711800
+ tz.transition 1996, 3, :o5, 827353800
+ tz.transition 1996, 9, :o2, 843247800
+ tz.transition 1997, 3, :o5, 858976200
+ tz.transition 1997, 9, :o2, 874870200
+ tz.transition 1998, 3, :o5, 890512200
+ tz.transition 1998, 9, :o2, 906406200
+ tz.transition 1999, 3, :o5, 922048200
+ tz.transition 1999, 9, :o2, 937942200
+ tz.transition 2000, 3, :o5, 953584200
+ tz.transition 2000, 9, :o2, 969478200
+ tz.transition 2001, 3, :o5, 985206600
+ tz.transition 2001, 9, :o2, 1001100600
+ tz.transition 2002, 3, :o5, 1016742600
+ tz.transition 2002, 9, :o2, 1032636600
+ tz.transition 2003, 3, :o5, 1048278600
+ tz.transition 2003, 9, :o2, 1064172600
+ tz.transition 2004, 3, :o5, 1079814600
+ tz.transition 2004, 9, :o2, 1095708600
+ tz.transition 2005, 3, :o5, 1111437000
+ tz.transition 2005, 9, :o2, 1127331000
+ end
+ end
+ end
+ end
end