Class: Tomo::Configuration::DSL::BatchBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/tomo/configuration/dsl/batch_block.rb

Instance Method Summary collapse

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