Class: Retab::CreateExperimentRequest

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

Constant Summary collapse

HASH_ATTRS =
{
  workflow_id: :workflow_id,
  block_id: :block_id,
  document_captures: :document_captures,
  documents: :documents,
  n_consensus: :n_consensus,
  name: :name,
  source_experiment_id: :source_experiment_id
}.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) ⇒ CreateExperimentRequest

Returns a new instance of CreateExperimentRequest.



27
28
29
30
31
32
33
34
35
36
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 27

def initialize(json)
  hash = self.class.normalize(json)
  @workflow_id = hash[:workflow_id]
  @block_id = hash[:block_id]
  @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]
  @source_experiment_id = hash[:source_experiment_id]
end

Instance Attribute Details

#block_idObject

Returns the value of attribute block_id.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def block_id
  @block_id
end

#document_capturesObject

Returns the value of attribute document_captures.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def document_captures
  @document_captures
end

#documentsObject

Returns the value of attribute documents.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def documents
  @documents
end

#n_consensusObject

Returns the value of attribute n_consensus.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def n_consensus
  @n_consensus
end

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def name
  @name
end

#source_experiment_idObject

Returns the value of attribute source_experiment_id.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def source_experiment_id
  @source_experiment_id
end

#workflow_idObject

Returns the value of attribute workflow_id.



18
19
20
# File 'lib/retab/workflow_experiments/create_experiment_request.rb', line 18

def workflow_id
  @workflow_id
end