Class: Scripted::Group
- Inherits:
-
Object
- Object
- Scripted::Group
- Defined in:
- lib/scripted/group.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #commands ⇒ Object
- #define(&block) ⇒ Object
-
#initialize(name) ⇒ Group
constructor
A new instance of Group.
- #parallel(&block) ⇒ Object
- #run(name, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ Group
Returns a new instance of Group.
8 9 10 11 12 |
# File 'lib/scripted/group.rb', line 8 def initialize(name) @name = name @parallel = false @parallel_id = (object_id ** 2) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/scripted/group.rb', line 6 def name @name end |
Instance Method Details
#commands ⇒ Object
30 31 32 |
# File 'lib/scripted/group.rb', line 30 def commands @commands ||= [] end |
#define(&block) ⇒ Object
14 15 16 |
# File 'lib/scripted/group.rb', line 14 def define(&block) instance_eval &block if block end |
#parallel(&block) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/scripted/group.rb', line 23 def parallel(&block) @parallel = true yield @parallel = false next_parallel_id end |