Class: Etna::Clients::Magma::Documents
- Inherits:
-
Object
- Object
- Etna::Clients::Magma::Documents
- Defined in:
- lib/etna/clients/magma/models.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #document(document_key) ⇒ Object
- #document_keys ⇒ Object
-
#initialize(raw = {}) ⇒ Documents
constructor
A new instance of Documents.
Constructor Details
#initialize(raw = {}) ⇒ Documents
Returns a new instance of Documents.
306 307 308 |
# File 'lib/etna/clients/magma/models.rb', line 306 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
304 305 306 |
# File 'lib/etna/clients/magma/models.rb', line 304 def raw @raw end |
Instance Method Details
#+(other) ⇒ Object
314 315 316 |
# File 'lib/etna/clients/magma/models.rb', line 314 def +(other) Documents.new({}.update(raw).update(other.raw)) end |
#document(document_key) ⇒ Object
318 319 320 321 |
# File 'lib/etna/clients/magma/models.rb', line 318 def document(document_key) return nil unless raw.include?(document_key) raw[document_key] end |
#document_keys ⇒ Object
310 311 312 |
# File 'lib/etna/clients/magma/models.rb', line 310 def document_keys raw.keys end |