Class: Retab::ClassificationWorkflowArtifact
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ClassificationWorkflowArtifact
- Defined in:
- lib/retab/workflow_artifacts/classification_workflow_artifact.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, file: :file, model: :model, categories: :categories, n_consensus: :n_consensus, instructions: :instructions, output: :output, consensus: :consensus, usage: :usage, created_at: :created_at, operation: :operation }.freeze
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#consensus ⇒ Object
Returns the value of attribute consensus.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#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.
-
#usage ⇒ Object
Returns the value of attribute usage.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ClassificationWorkflowArtifact
constructor
A new instance of ClassificationWorkflowArtifact.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ClassificationWorkflowArtifact
Returns a new instance of ClassificationWorkflowArtifact.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 35 def initialize(json) hash = self.class.normalize(json) @id = hash[:id] @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil @model = hash[:model] @categories = (hash[:categories] || []).map { |item| item ? Retab::Category.new(item) : nil } @n_consensus = hash[:n_consensus] @instructions = hash[:instructions] @output = hash[:output] ? Retab::ClassificationDecision.new(hash[:output]) : nil @consensus = hash[:consensus] ? Retab::ClassificationConsensus.new(hash[:consensus]) : nil @usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil @created_at = hash[:created_at] @operation = hash[:operation] end |
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def categories @categories end |
#consensus ⇒ Object
Returns the value of attribute consensus.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def consensus @consensus end |
#created_at ⇒ Object
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def created_at @created_at end |
#file ⇒ Object
Returns the value of attribute file.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def id @id end |
#instructions ⇒ Object
Returns the value of attribute instructions.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def instructions @instructions end |
#model ⇒ Object
Returns the value of attribute model.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def model @model end |
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def n_consensus @n_consensus end |
#operation ⇒ Object
Returns the value of attribute operation.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def operation @operation end |
#output ⇒ Object
Returns the value of attribute output.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def output @output end |
#usage ⇒ Object
Returns the value of attribute usage.
22 23 24 |
# File 'lib/retab/workflow_artifacts/classification_workflow_artifact.rb', line 22 def usage @usage end |