module MongoModel::AttributeMethods
Public Instance Methods
clone_attribute_value(attribute_name)
click to toggle source
# File lib/mongomodel/concerns/attribute_methods.rb, line 59 def clone_attribute_value(attribute_name) value = read_attribute(attribute_name) value.duplicable? ? value.clone : value rescue TypeError, NoMethodError value end
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/mongomodel/concerns/attribute_methods.rb, line 40 def method_missing(method, *args, &block) unless self.class.attribute_methods_generated? self.class.define_attribute_methods if respond_to_without_attributes?(method) send(method, *args, &block) else super end else super end end
respond_to?(*args)
click to toggle source
Calls superclass method
# File lib/mongomodel/concerns/attribute_methods.rb, line 54 def respond_to?(*args) self.class.define_attribute_methods unless self.class.attribute_methods_generated? super end
Protected Instance Methods
attribute_method?(attr_name)
click to toggle source
# File lib/mongomodel/concerns/attribute_methods.rb, line 67 def attribute_method?(attr_name) properties.has_key?(attr_name) end