class Repeatable::Expression::Date
Public Instance Methods
==(other)
click to toggle source
# File lib/repeatable/expression/date.rb, line 8 def ==(other) other.is_a?(self.class) && attributes == other.attributes end
Also aliased as: eql?
hash()
click to toggle source
# File lib/repeatable/expression/date.rb, line 14 def hash [attributes.values, self.class.name].hash end
to_h()
click to toggle source
# File lib/repeatable/expression/date.rb, line 4 def to_h Hash[hash_key, attributes] end
Protected Instance Methods
attributes()
click to toggle source
# File lib/repeatable/expression/date.rb, line 20 def attributes instance_variables.each_with_object({}) do |name, hash| key = name.to_s.gsub(/^@/, "").to_sym hash[key] = normalize_attribute_value(instance_variable_get(name)) end end
normalize_attribute_value(value)
click to toggle source
# File lib/repeatable/expression/date.rb, line 27 def normalize_attribute_value(value) case value when ::Date value.to_s else value end end