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