Class: Retab::ReconstructRequest

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/retab/splits/reconstruct_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  document: :document,
  subdocuments: :subdocuments
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#documentObject

Returns the value of attribute document.



13
14
15
# File 'lib/retab/splits/reconstruct_request.rb', line 13

def document
  @document
end

#subdocumentsObject

Returns the value of attribute subdocuments.



13
14
15
# File 'lib/retab/splits/reconstruct_request.rb', line 13

def subdocuments
  @subdocuments
end