Class: Retab::ReconstructRequest
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ReconstructRequest
- Defined in:
- lib/retab/splits/reconstruct_request.rb
Constant Summary collapse
- HASH_ATTRS =
{ document: :document, subdocuments: :subdocuments }.freeze
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#subdocuments ⇒ Object
Returns the value of attribute subdocuments.
Instance Method Summary collapse
-
#initialize(json) ⇒ ReconstructRequest
constructor
A new instance of ReconstructRequest.
Constructor Details
#initialize(json) ⇒ ReconstructRequest
Returns a new instance of ReconstructRequest.
18 19 20 21 22 23 |
# File 'lib/retab/splits/reconstruct_request.rb', line 18 def initialize(json) super() hash = self.class.normalize(json) @document = hash[:document] ? Retab::ReconstructDocumentRef.new(hash[:document]) : nil @subdocuments = (hash[:subdocuments] || []).map { |item| item ? Retab::ReconstructSubdocument.new(item) : nil } end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
13 14 15 |
# File 'lib/retab/splits/reconstruct_request.rb', line 13 def document @document end |
#subdocuments ⇒ Object
Returns the value of attribute subdocuments.
13 14 15 |
# File 'lib/retab/splits/reconstruct_request.rb', line 13 def subdocuments @subdocuments end |