Class: Retab::WorkflowEvalRun
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::WorkflowEvalRun
- Defined in:
- lib/retab/workflow_eval_runs/workflow_eval_run.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow_id: :workflow_id, workflow_version_id: :workflow_version_id, trigger: :trigger, lifecycle: :lifecycle, timing: :timing, target: :target, eval_id: :eval_id, total_evals: :total_evals, counts: :counts, freshness: :freshness }.freeze
Instance Attribute Summary collapse
-
#counts ⇒ Object
Returns the value of attribute counts.
-
#eval_id ⇒ Object
Returns the value of attribute eval_id.
-
#freshness ⇒ Object
Returns the value of attribute freshness.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
-
#target ⇒ Object
Returns the value of attribute target.
-
#timing ⇒ Object
Returns the value of attribute timing.
-
#total_evals ⇒ Object
Returns the value of attribute total_evals.
-
#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) ⇒ WorkflowEvalRun
constructor
A new instance of WorkflowEvalRun.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ WorkflowEvalRun
Returns a new instance of WorkflowEvalRun.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 36 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::EvalRunTrigger.new(hash[:trigger]) : nil @lifecycle = hash[:lifecycle] ? ( case hash[:lifecycle][:status] when "cancelled" Retab::CancelledWorkflowEvalRun.new(hash[:lifecycle]) when "completed" Retab::CompletedWorkflowEvalRun.new(hash[:lifecycle]) when "error" Retab::ErrorWorkflowEvalRun.new(hash[:lifecycle]) when "pending" Retab::PendingWorkflowEvalRun.new(hash[:lifecycle]) when "queued" Retab::QueuedWorkflowEvalRun.new(hash[:lifecycle]) when "running" Retab::RunningWorkflowEvalRun.new(hash[:lifecycle]) else hash[:lifecycle] end ) : nil @timing = hash[:timing] ? Retab::WorkflowEvalRunTiming.new(hash[:timing]) : nil @target = hash[:target] ? Retab::EvalRunBlockTarget.new(hash[:target]) : nil @eval_id = hash[:eval_id] @total_evals = hash[:total_evals] @counts = hash[:counts] ? Retab::BlockEvalBatchExecutionCounts.new(hash[:counts]) : nil @freshness = hash[:freshness] ? Retab::EvalRunFreshness.new(hash[:freshness]) : nil end |
Instance Attribute Details
#counts ⇒ Object
Returns the value of attribute counts.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def counts @counts end |
#eval_id ⇒ Object
Returns the value of attribute eval_id.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def eval_id @eval_id end |
#freshness ⇒ Object
Returns the value of attribute freshness.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def freshness @freshness end |
#id ⇒ Object
Returns the value of attribute id.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def id @id end |
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def lifecycle @lifecycle end |
#target ⇒ Object
Returns the value of attribute target.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def target @target end |
#timing ⇒ Object
Returns the value of attribute timing.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def timing @timing end |
#total_evals ⇒ Object
Returns the value of attribute total_evals.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def total_evals @total_evals end |
#trigger ⇒ Object
Returns the value of attribute trigger.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def trigger @trigger end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def workflow_id @workflow_id end |
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
22 23 24 |
# File 'lib/retab/workflow_eval_runs/workflow_eval_run.rb', line 22 def workflow_version_id @workflow_version_id end |