Class: Ecoportal::API::Common::BaseModel
- Inherits:
-
Object
- Object
- Ecoportal::API::Common::BaseModel
- Defined in:
- lib/eco/api/common/version_patches/ecoportal_api/base_model.rb
Instance Attribute Summary collapse
-
#initial_doc ⇒ Object
readonly
Returns the value of attribute initial_doc.
Instance Method Summary collapse
-
#initialize(doc = {}, parent: self, key: nil) ⇒ BaseModel
constructor
A new instance of BaseModel.
Constructor Details
#initialize(doc = {}, parent: self, key: nil) ⇒ BaseModel
8 9 10 11 12 13 14 15 16 |
# File 'lib/eco/api/common/version_patches/ecoportal_api/base_model.rb', line 8 def initialize(doc = {}, parent: self, key: nil) @_parent = parent @_key = key if !_parent || !_key @doc = doc @original_doc = JSON.parse(@doc.to_json) @initial_doc = JSON.parse(@doc.to_json) end end |
Instance Attribute Details
#initial_doc ⇒ Object (readonly)
Returns the value of attribute initial_doc.
6 7 8 |
# File 'lib/eco/api/common/version_patches/ecoportal_api/base_model.rb', line 6 def initial_doc @initial_doc end |