lib/timing/time_in_zone.rb in timing-0.0.6 vs lib/timing/time_in_zone.rb in timing-0.0.7

- old
+ new

@@ -3,11 +3,11 @@ extend Forwardable REGEXP = /[+-]\d\d:?\d\d/ - def_delegators :time, :to_i, :to_f, :to_date, :to_datetime, :<, :<=, :==, :>, :>=, :between?, :eql?, :hash + def_delegators :time, :to_i, :to_f, :to_date, :to_datetime, :between?, :==, :<, :<=, :>, :>=, :<=>, :hash def_delegators :time_with_offset, :year, :month, :day, :hour, :min, :sec, :wday, :yday attr_reader :zone_offset def initialize(time, zone_offset=nil) @@ -31,9 +31,11 @@ def -(seconds) raise ArgumentError, "#{seconds} must be a time or a valid seconds count" unless seconds.respond_to? :to_f result = self.class.at (time.to_f - seconds.to_f), zone_offset seconds.is_a?(Numeric) ? result : result.to_f end + + alias_method :eql?, :== def utc? zone_offset == 0 end alias_method :gmt?, :utc? \ No newline at end of file