lib/tzinfo/timezone_transition_info.rb in tzinfo-0.3.35 vs lib/tzinfo/timezone_transition_info.rb in tzinfo-0.3.36
- old
+ new
@@ -1,7 +1,7 @@
#--
-# Copyright (c) 2006-2010 Philip Ross
+# Copyright (c) 2006-2012 Philip Ross
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -96,22 +96,21 @@
# Returns true if this TimezoneTransitionInfo is equal to the given
# TimezoneTransitionInfo. Two TimezoneTransitionInfo instances are
# considered to be equal by == if offset, previous_offset and at are all
# equal.
def ==(tti)
- tti.respond_to?(:offset) && tti.respond_to?(:previous_offset) && tti.respond_to?(:at) &&
+ tti.kind_of?(TimezoneTransitionInfo) &&
offset == tti.offset && previous_offset == tti.previous_offset && at == tti.at
end
# Returns true if this TimezoneTransitionInfo is equal to the given
# TimezoneTransitionInfo. Two TimezoneTransitionInfo instances are
# considered to be equal by eql? if offset, previous_offset,
# numerator_or_time and denominator are all equal. This is stronger than ==,
# which just requires the at times to be equal regardless of how they were
# originally specified.
def eql?(tti)
- tti.respond_to?(:offset) && tti.respond_to?(:previous_offset) &&
- tti.respond_to?(:numerator_or_time) && tti.respond_to?(:denominator) &&
+ tti.kind_of?(TimezoneTransitionInfo) &&
offset == tti.offset && previous_offset == tti.previous_offset &&
numerator_or_time == tti.numerator_or_time && denominator == tti.denominator
end
# Returns a hash of this TimezoneTransitionInfo instance.