Class: Retab::ExperimentRun
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ExperimentRun
- Defined in:
- lib/retab/experiment_runs/experiment_run.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow_id: :workflow_id, workflow_version_id: :workflow_version_id, trigger: :trigger, experiment_id: :experiment_id, block_id: :block_id, block_type: :block_type, n_consensus: :n_consensus, lifecycle: :lifecycle, timing: :timing, parent_run_id: :parent_run_id, definition_fingerprint: :definition_fingerprint, documents_fingerprint: :documents_fingerprint, score: :score, total_document_count: :total_document_count, completed_document_count: :completed_document_count, document_count: :document_count, error_count: :error_count }.freeze
Instance Attribute Summary collapse
-
#block_id ⇒ Object
Returns the value of attribute block_id.
-
#block_type ⇒ Object
Returns the value of attribute block_type.
-
#completed_document_count ⇒ Object
Returns the value of attribute completed_document_count.
-
#definition_fingerprint ⇒ Object
Returns the value of attribute definition_fingerprint.
-
#document_count ⇒ Object
Returns the value of attribute document_count.
-
#documents_fingerprint ⇒ Object
Returns the value of attribute documents_fingerprint.
-
#error_count ⇒ Object
Returns the value of attribute error_count.
-
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
-
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
-
#parent_run_id ⇒ Object
Returns the value of attribute parent_run_id.
-
#score ⇒ Object
Returns the value of attribute score.
-
#timing ⇒ Object
Returns the value of attribute timing.
-
#total_document_count ⇒ Object
Returns the value of attribute total_document_count.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
-
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ExperimentRun
constructor
A new instance of ExperimentRun.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ExperimentRun
Returns a new instance of ExperimentRun.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 50 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @workflow_id = hash[:workflow_id] @workflow_version_id = hash[:workflow_version_id] @trigger = hash[:trigger] ? Retab::ExperimentRunTrigger.new(hash[:trigger]) : nil @experiment_id = hash[:experiment_id] @block_id = hash[:block_id] @block_type = hash[:block_type] @n_consensus = hash[:n_consensus] @lifecycle = hash[:lifecycle] ? ( case hash[:lifecycle][:status] when "cancelled" Retab::CancelledWorkflowExperimentRun.new(hash[:lifecycle]) when "completed" Retab::CompletedWorkflowExperimentRun.new(hash[:lifecycle]) when "error" Retab::ErrorWorkflowExperimentRun.new(hash[:lifecycle]) when "pending" Retab::PendingWorkflowExperimentRun.new(hash[:lifecycle]) when "queued" Retab::QueuedWorkflowExperimentRun.new(hash[:lifecycle]) when "running" Retab::RunningWorkflowExperimentRun.new(hash[:lifecycle]) else hash[:lifecycle] end ) : nil @timing = hash[:timing] ? Retab::ExperimentRunTiming.new(hash[:timing]) : nil @parent_run_id = hash[:parent_run_id] @definition_fingerprint = hash[:definition_fingerprint] @documents_fingerprint = hash[:documents_fingerprint] @score = hash[:score] @total_document_count = hash[:total_document_count] @completed_document_count = hash[:completed_document_count] @document_count = hash[:document_count] @error_count = hash[:error_count] end |
Instance Attribute Details
#block_id ⇒ Object
Returns the value of attribute block_id.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def block_id @block_id end |
#block_type ⇒ Object
Returns the value of attribute block_type.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def block_type @block_type end |
#completed_document_count ⇒ Object
Returns the value of attribute completed_document_count.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def completed_document_count @completed_document_count end |
#definition_fingerprint ⇒ Object
Returns the value of attribute definition_fingerprint.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def definition_fingerprint @definition_fingerprint end |
#document_count ⇒ Object
Returns the value of attribute document_count.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def document_count @document_count end |
#documents_fingerprint ⇒ Object
Returns the value of attribute documents_fingerprint.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def documents_fingerprint @documents_fingerprint end |
#error_count ⇒ Object
Returns the value of attribute error_count.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def error_count @error_count end |
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def experiment_id @experiment_id end |
#id ⇒ Object
Returns the value of attribute id.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def id @id end |
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def lifecycle @lifecycle end |
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def n_consensus @n_consensus end |
#parent_run_id ⇒ Object
Returns the value of attribute parent_run_id.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def parent_run_id @parent_run_id end |
#score ⇒ Object
Returns the value of attribute score.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def score @score end |
#timing ⇒ Object
Returns the value of attribute timing.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def timing @timing end |
#total_document_count ⇒ Object
Returns the value of attribute total_document_count.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def total_document_count @total_document_count end |
#trigger ⇒ Object
Returns the value of attribute trigger.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def trigger @trigger end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def workflow_id @workflow_id end |
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
29 30 31 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 29 def workflow_version_id @workflow_version_id end |