Class: HastCI::TaskResult
- Inherits:
-
Object
- Object
- HastCI::TaskResult
- Defined in:
- lib/hastci/task_result.rb
Instance Attribute Summary collapse
-
#duration_s ⇒ Object
readonly
Returns the value of attribute duration_s.
-
#logs ⇒ Object
readonly
Returns the value of attribute logs.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #failed? ⇒ Boolean
- #hash ⇒ Object
-
#initialize(task_id:, status:, duration_s:, logs:) ⇒ TaskResult
constructor
A new instance of TaskResult.
- #passed? ⇒ Boolean
Constructor Details
#initialize(task_id:, status:, duration_s:, logs:) ⇒ TaskResult
Returns a new instance of TaskResult.
7 8 9 10 11 12 13 |
# File 'lib/hastci/task_result.rb', line 7 def initialize(task_id:, status:, duration_s:, logs:) @task_id = task_id @status = status @duration_s = duration_s @logs = logs freeze end |
Instance Attribute Details
#duration_s ⇒ Object (readonly)
Returns the value of attribute duration_s.
5 6 7 |
# File 'lib/hastci/task_result.rb', line 5 def duration_s @duration_s end |
#logs ⇒ Object (readonly)
Returns the value of attribute logs.
5 6 7 |
# File 'lib/hastci/task_result.rb', line 5 def logs @logs end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/hastci/task_result.rb', line 5 def status @status end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
5 6 7 |
# File 'lib/hastci/task_result.rb', line 5 def task_id @task_id end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
23 24 25 26 27 28 29 |
# File 'lib/hastci/task_result.rb', line 23 def ==(other) other.is_a?(TaskResult) && other.task_id == task_id && other.status == status && other.duration_s == duration_s && other.logs == logs end |
#failed? ⇒ Boolean
19 20 21 |
# File 'lib/hastci/task_result.rb', line 19 def failed? status == :failed end |
#hash ⇒ Object
33 34 35 |
# File 'lib/hastci/task_result.rb', line 33 def hash [task_id, status, duration_s, logs].hash end |
#passed? ⇒ Boolean
15 16 17 |
# File 'lib/hastci/task_result.rb', line 15 def passed? status == :passed end |