Module: Her::Model::ORM::SerializationMethods
- Extended by:
- ActiveSupport::Concern
- Included in:
- Her::Model::ORM
- Defined in:
- lib/her/model/orm/serialization_methods.rb
Instance Method Summary collapse
-
#hash ⇒ Object
Delegate to @data, allowing models to act correctly in code like: [ Model.find(1), Model.find(1) ].uniq # => [ Model.find(1) ].
-
#to_params ⇒ Object
Convert into a hash of request parameters.
Instance Method Details
#hash ⇒ Object
9 10 11 |
# File 'lib/her/model/orm/serialization_methods.rb', line 9 def hash @data.hash end |
#to_params ⇒ Object
Convert into a hash of request parameters
18 19 20 21 22 23 24 |
# File 'lib/her/model/orm/serialization_methods.rb', line 18 def to_params if self.class.include_root_in_json { (self.class.include_root_in_json == true ? self.class.root_element : self.class.include_root_in_json) => @data.dup } else @data.dup end end |