module OceanDynamo::Basal
Public Instance Methods
<=>(other_object)
click to toggle source
Allows sort on instances
# File lib/ocean-dynamo/basal.rb, line 20 def <=>(other_object) if other_object.is_a?(self.class) self.to_key <=> other_object.to_key end end
==(comparison_object)
click to toggle source
The equality comparator.
Calls superclass method
# File lib/ocean-dynamo/basal.rb, line 7 def ==(comparison_object) super || comparison_object.instance_of?(self.class) && hash_key.present? && comparison_object.hash_key == hash_key && (range_key == comparison_object.range_key) end
Also aliased as: eql?
freeze()
click to toggle source
Clone and freeze the attributes hash such that associations are still accessible, even on destroyed records, but cloned models will not be frozen.
# File lib/ocean-dynamo/basal.rb, line 32 def freeze @attributes = @attributes.clone.freeze self end
frozen?()
click to toggle source
Returns true
if the attributes hash has been frozen.
# File lib/ocean-dynamo/basal.rb, line 41 def frozen? @attributes.frozen? end