Class: Volley::Dsl::Stage
- Inherits:
-
Object
- Object
- Volley::Dsl::Stage
- Defined in:
- lib/volley/dsl/stage.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
Instance Method Summary collapse
- #action(name, options = {}, &block) ⇒ Object
- #add(action) ⇒ Object
- #call ⇒ Object
- #count ⇒ Object
-
#initialize(name, options = {}, &block) ⇒ Stage
constructor
A new instance of Stage.
Constructor Details
#initialize(name, options = {}, &block) ⇒ Stage
Returns a new instance of Stage.
6 7 8 9 10 11 12 13 14 |
# File 'lib/volley/dsl/stage.rb', line 6 def initialize(name, ={}, &block) @name = name.to_sym @plan = .delete(:plan) @options = { }.merge() @actions = [] raise "plan instance must be set" unless @plan instance_eval &block if block_given? end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
5 6 7 |
# File 'lib/volley/dsl/stage.rb', line 5 def actions @actions end |
Instance Method Details
#action(name, options = {}, &block) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/volley/dsl/stage.rb', line 30 def action(name, ={}, &block) o = { :stage => @name, :plan => nil, }.merge() @actions << Volley::Dsl::Action.new(name, o, &block) end |
#add(action) ⇒ Object
22 23 24 |
# File 'lib/volley/dsl/stage.rb', line 22 def add(action) @actions << action end |
#call ⇒ Object
16 17 18 19 20 |
# File 'lib/volley/dsl/stage.rb', line 16 def call @actions.each do |action| action.call end end |
#count ⇒ Object
26 27 28 |
# File 'lib/volley/dsl/stage.rb', line 26 def count @actions.count end |