Module: Mongoid::Extensions::Object::Conversions::ClassMethods
- Defined in:
- lib/mongoid/extensions/object/conversions.rb
Instance Method Summary collapse
Instance Method Details
#get(value) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/mongoid/extensions/object/conversions.rb', line 14 def get(value) if value && respond_to?(:instantiate) instantiate(value) else value end end |
#set(value) ⇒ Object
10 11 12 |
# File 'lib/mongoid/extensions/object/conversions.rb', line 10 def set(value) value.respond_to?(:attributes) ? value.attributes : value end |