Module: MongoODM::Document::AttributeMethods::ClassMethods

Defined in:
lib/mongo_odm/document/attribute_methods.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) default_attributes



94
95
96
# File 'lib/mongo_odm/document/attribute_methods.rb', line 94

def default_attributes
  HashWithIndifferentAccess[fields.values.map{|field| [field.name, field.default.respond_to?(:call) ? field.default.call : field.default]}]
end

- (Object) define_attribute_methods_for_fields



98
99
100
# File 'lib/mongo_odm/document/attribute_methods.rb', line 98

def define_attribute_methods_for_fields
  define_attribute_methods(fields.keys + [:_id, :_class])
end