Class: Retab::UpdateExperimentRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_experiments/update_experiment_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  document_captures: :document_captures,
  documents: :documents,
  n_consensus: :n_consensus,
  name: :name
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ UpdateExperimentRequest

Returns a new instance of UpdateExperimentRequest.



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/retab/workflow_experiments/update_experiment_request.rb', line 22

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @document_captures = (hash[:document_captures] || []).map { |item|
    item ? Retab::ExperimentDocumentCaptureRequest.new(item) : nil
  }
  @documents = (hash[:documents] || []).map { |item|
    item ? Retab::ExplicitExperimentDocumentRequest.new(item) : nil
  }
  @n_consensus = hash[:n_consensus]
  @name = hash[:name]
end

Instance Attribute Details

#document_capturesObject

Returns the value of attribute document_captures.



15
16
17
# File 'lib/retab/workflow_experiments/update_experiment_request.rb', line 15

def document_captures
  @document_captures
end

#documentsObject

Returns the value of attribute documents.



15
16
17
# File 'lib/retab/workflow_experiments/update_experiment_request.rb', line 15

def documents
  @documents
end

#n_consensusObject

Returns the value of attribute n_consensus.



15
16
17
# File 'lib/retab/workflow_experiments/update_experiment_request.rb', line 15

def n_consensus
  @n_consensus
end

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/retab/workflow_experiments/update_experiment_request.rb', line 15

def name
  @name
end