Class: Retab::SplitWorkflowArtifact
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::SplitWorkflowArtifact
- Defined in:
- lib/retab/workflow_artifacts/split_workflow_artifact.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, file: :file, model: :model, subdocuments: :subdocuments, n_consensus: :n_consensus, instructions: :instructions, output: :output, status: :status, error: :error, consensus: :consensus, usage: :usage, created_at: :created_at, operation: :operation }.freeze
Instance Attribute Summary collapse
-
#consensus ⇒ Object
Returns the value of attribute consensus.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#error ⇒ Object
Returns the value of attribute error.
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#model ⇒ Object
Returns the value of attribute model.
-
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#output ⇒ Object
Returns the value of attribute output.
-
#status ⇒ Object
Returns the value of attribute status.
-
#subdocuments ⇒ Object
Returns the value of attribute subdocuments.
-
#usage ⇒ Object
Returns the value of attribute usage.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ SplitWorkflowArtifact
constructor
A new instance of SplitWorkflowArtifact.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ SplitWorkflowArtifact
Returns a new instance of SplitWorkflowArtifact.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 40 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil @model = hash[:model] @subdocuments = (hash[:subdocuments] || []).map { |item| item ? Retab::Subdocument.new(item) : nil } @n_consensus = hash[:n_consensus] @instructions = hash[:instructions] @output = (hash[:output] || []).map { |item| item ? Retab::SplitResult.new(item) : nil } @status = hash[:status].nil? ? "pending" : hash[:status] @error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil @consensus = hash[:consensus] ? Retab::SplitConsensus.new(hash[:consensus]) : nil @usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil @created_at = hash[:created_at] @operation = hash[:operation].nil? ? "split" : hash[:operation] end |
Instance Attribute Details
#consensus ⇒ Object
Returns the value of attribute consensus.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def consensus @consensus end |
#created_at ⇒ Object
Returns the value of attribute created_at.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def created_at @created_at end |
#error ⇒ Object
Returns the value of attribute error.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def error @error end |
#file ⇒ Object
Returns the value of attribute file.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def id @id end |
#instructions ⇒ Object
Returns the value of attribute instructions.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def instructions @instructions end |
#model ⇒ Object
Returns the value of attribute model.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def model @model end |
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def n_consensus @n_consensus end |
#operation ⇒ Object
Returns the value of attribute operation.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def operation @operation end |
#output ⇒ Object
Returns the value of attribute output.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def output @output end |
#status ⇒ Object
Returns the value of attribute status.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def status @status end |
#subdocuments ⇒ Object
Returns the value of attribute subdocuments.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def subdocuments @subdocuments end |
#usage ⇒ Object
Returns the value of attribute usage.
24 25 26 |
# File 'lib/retab/workflow_artifacts/split_workflow_artifact.rb', line 24 def usage @usage end |