Class: BambooApi::Stage
- Inherits:
-
Object
- Object
- BambooApi::Stage
- Defined in:
- lib/bamboo_api/stage.rb
Instance Attribute Summary collapse
-
#collapsed_by_default ⇒ Object
readonly
Returns the value of attribute collapsed_by_default.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#display_class ⇒ Object
readonly
Returns the value of attribute display_class.
-
#display_message ⇒ Object
readonly
Returns the value of attribute display_message.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#life_cycle_state ⇒ Object
readonly
Returns the value of attribute life_cycle_state.
-
#manual ⇒ Object
readonly
Returns the value of attribute manual.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#restartable ⇒ Object
readonly
Returns the value of attribute restartable.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(restartable, manual, collapsed_by_default, display_message, display_class, life_cycle_state, state, id, name, description) ⇒ Stage
constructor
A new instance of Stage.
- #successful? ⇒ Boolean
Constructor Details
#initialize(restartable, manual, collapsed_by_default, display_message, display_class, life_cycle_state, state, id, name, description) ⇒ Stage
Returns a new instance of Stage.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bamboo_api/stage.rb', line 6 def initialize restartable, manual, collapsed_by_default, , display_class, life_cycle_state, state, id, name, description @restartable = restartable @manual = manual @collapsed_by_default = collapsed_by_default @display_message = @display_class = display_class @life_cycle_state = life_cycle_state @state = state @id = id @name = name @description = description end |
Instance Attribute Details
#collapsed_by_default ⇒ Object (readonly)
Returns the value of attribute collapsed_by_default.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def collapsed_by_default @collapsed_by_default end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def description @description end |
#display_class ⇒ Object (readonly)
Returns the value of attribute display_class.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def display_class @display_class end |
#display_message ⇒ Object (readonly)
Returns the value of attribute display_message.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def @display_message end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def id @id end |
#life_cycle_state ⇒ Object (readonly)
Returns the value of attribute life_cycle_state.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def life_cycle_state @life_cycle_state end |
#manual ⇒ Object (readonly)
Returns the value of attribute manual.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def manual @manual end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def name @name end |
#restartable ⇒ Object (readonly)
Returns the value of attribute restartable.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def restartable @restartable end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/bamboo_api/stage.rb', line 3 def state @state end |
Class Method Details
.parse(stages) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/bamboo_api/stage.rb', line 29 def self.parse stages parsed_stages = [] stages[ "stages" ][ "stage" ].each do | stage | parsed_stages.push( BambooApi::Stage.parse_single( stage ) ) end parsed_stages end |
.parse_single(stage) ⇒ Object
38 39 40 41 |
# File 'lib/bamboo_api/stage.rb', line 38 def self.parse_single stage BambooApi::Stage.new stage[ "restartable" ], stage[ "manual" ], stage[ "collapsedByDefault" ], stage[ "displayMessage" ], stage[ "displayClass" ], stage[ "lifeCycleState" ], stage[ "state" ], stage[ "id" ], stage[ "name" ], stage[ "description" ] end |
Instance Method Details
#failed? ⇒ Boolean
25 26 27 |
# File 'lib/bamboo_api/stage.rb', line 25 def failed? self.state == "Failed" end |
#successful? ⇒ Boolean
21 22 23 |
# File 'lib/bamboo_api/stage.rb', line 21 def successful? self.state == "Successful" end |