Class: Itamae::Handler::Base
- Inherits:
-
Object
- Object
- Itamae::Handler::Base
- Defined in:
- lib/itamae/handler/base.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#recipes ⇒ Object
readonly
Returns the value of attribute recipes.
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Instance Method Summary collapse
- #event(type, payload = {}) ⇒ Object
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/itamae/handler/base.rb', line 8 def initialize() @options = @recipes = [] @resources = [] @actions = [] end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
6 7 8 |
# File 'lib/itamae/handler/base.rb', line 6 def actions @actions end |
#recipes ⇒ Object (readonly)
Returns the value of attribute recipes.
6 7 8 |
# File 'lib/itamae/handler/base.rb', line 6 def recipes @recipes end |
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
6 7 8 |
# File 'lib/itamae/handler/base.rb', line 6 def resources @resources end |
Instance Method Details
#event(type, payload = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/itamae/handler/base.rb', line 16 def event(type, payload = {}) case type when :recipe_started @recipes << payload when :recipe_completed, :recipe_failed @recipes.pop when :resource_started @resources << payload when :resource_completed, :resource_failed @resources.pop when :action_started @actions << payload when :action_completed, :action_failed @actions.pop end end |