Class: Tomo::Configuration::DSL::BatchBlock
- Inherits:
-
Object
- Object
- Tomo::Configuration::DSL::BatchBlock
- Defined in:
- lib/tomo/configuration/dsl/batch_block.rb
Instance Method Summary collapse
-
#initialize(batch) ⇒ BatchBlock
constructor
A new instance of BatchBlock.
- #run(task, privileged: false) ⇒ Object
Constructor Details
#initialize(batch) ⇒ BatchBlock
Returns a new instance of BatchBlock.
7 8 9 |
# File 'lib/tomo/configuration/dsl/batch_block.rb', line 7 def initialize(batch) @batch = batch end |
Instance Method Details
#run(task, privileged: false) ⇒ Object
11 12 13 14 15 |
# File 'lib/tomo/configuration/dsl/batch_block.rb', line 11 def run(task, privileged: false) task = String.new(task).extend(Runtime::PrivilegedTask) if privileged @batch << task self end |