Class: Retab::SplitRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/splits/split_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  document: :document,
  subdocuments: :subdocuments,
  model: :model,
  instructions: :instructions,
  n_consensus: :n_consensus,
  bust_cache: :bust_cache
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ SplitRequest

Returns a new instance of SplitRequest.



25
26
27
28
29
30
31
32
33
# File 'lib/retab/splits/split_request.rb', line 25

def initialize(json)
  hash = self.class.normalize(json)
  @document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
  @subdocuments = (hash[:subdocuments] || []).map { |item| item ? Retab::Subdocument.new(item) : nil }
  @model = hash[:model]
  @instructions = hash[:instructions]
  @n_consensus = hash[:n_consensus]
  @bust_cache = hash[:bust_cache]
end

Instance Attribute Details

#bust_cacheObject

Returns the value of attribute bust_cache.



17
18
19
# File 'lib/retab/splits/split_request.rb', line 17

def bust_cache
  @bust_cache
end

#documentObject

Returns the value of attribute document.



17
18
19
# File 'lib/retab/splits/split_request.rb', line 17

def document
  @document
end

#instructionsObject

Returns the value of attribute instructions.



17
18
19
# File 'lib/retab/splits/split_request.rb', line 17

def instructions
  @instructions
end

#modelObject

Returns the value of attribute model.



17
18
19
# File 'lib/retab/splits/split_request.rb', line 17

def model
  @model
end

#n_consensusObject

Returns the value of attribute n_consensus.



17
18
19
# File 'lib/retab/splits/split_request.rb', line 17

def n_consensus
  @n_consensus
end

#subdocumentsObject

Returns the value of attribute subdocuments.



17
18
19
# File 'lib/retab/splits/split_request.rb', line 17

def subdocuments
  @subdocuments
end