lib/repeatable/expression/date.rb in repeatable-0.6.0 vs lib/repeatable/expression/date.rb in repeatable-1.0.0
- old
+ new
@@ -1,27 +1,26 @@
module Repeatable
module Expression
class Date < Base
-
def to_h
Hash[hash_key, attributes]
end
def ==(other)
other.is_a?(self.class) && attributes == other.attributes
end
- alias eql? ==
+ alias_method :eql?, :==
def hash
[attributes.values, self.class.name].hash
end
protected
def attributes
instance_variables.each_with_object({}) do |name, hash|
- key = name.to_s.gsub(/^@/, '').to_sym
+ key = name.to_s.gsub(/^@/, "").to_sym
hash[key] = normalize_attribute_value(instance_variable_get(name))
end
end
def normalize_attribute_value(value)