Module: MongoODM::Document::AttributeMethods::ClassMethods
- Defined in:
- lib/mongo_odm/document/attribute_methods.rb
Instance Method Summary collapse
Instance Method Details
#default_attributes ⇒ Object
| 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 | 
#define_attribute_methods_for_fields ⇒ Object
| 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 |