Class: CircleCI::CLI::Response::Step
- Inherits:
-
Object
- Object
- CircleCI::CLI::Response::Step
- Defined in:
- lib/circleci/cli/response/step.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #actions ⇒ Object
-
#initialize(type, hash) ⇒ Step
constructor
A new instance of Step.
- #status ⇒ Object
Constructor Details
#initialize(type, hash) ⇒ Step
Returns a new instance of Step.
9 10 11 12 13 |
# File 'lib/circleci/cli/response/step.rb', line 9 def initialize(type, hash) @type = type @name = hash['name'] @hash = hash end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/circleci/cli/response/step.rb', line 7 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/circleci/cli/response/step.rb', line 7 def type @type end |
Instance Method Details
#actions ⇒ Object
15 16 17 |
# File 'lib/circleci/cli/response/step.rb', line 15 def actions @hash['actions'].map { |a| Action.new(a) } end |
#status ⇒ Object
19 20 21 22 23 24 |
# File 'lib/circleci/cli/response/step.rb', line 19 def status return 'running' if actions.any? { |action| action.end_time.nil? } return 'failed' if actions.any?(&:failed?) 'success' end |