Class: Coral::Util::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/coral_core/util/process.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &code) ⇒ Process


Constructor / Destructor



9
10
11
12
# File 'lib/coral_core/util/process.rb', line 9

def initialize(name, &code)
  @name = name   
  @code = code
end

Instance Attribute Details

#nameObject (readonly)


Property accessors / modifiers



17
18
19
# File 'lib/coral_core/util/process.rb', line 17

def name
  @name
end

Instance Method Details

#action(action_name, options = {}) ⇒ Object


Actions



30
31
32
33
34
# File 'lib/coral_core/util/process.rb', line 30

def action(action_name, options = {})
  if action_name == :run
    run(options)  
  end
end

#provider_optionsObject




21
22
23
24
25
# File 'lib/coral_core/util/process.rb', line 21

def provider_options
  return {
    :parallel => true
  }
end

#run(options = {}) ⇒ Object




38
39
40
# File 'lib/coral_core/util/process.rb', line 38

def run(options = {})
  @code.call(options)
end