Module: Yawl::ProcessDefinitions

Defined in:
lib/yawl/process_definitions.rb

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



3
4
5
# File 'lib/yawl/process_definitions.rb', line 3

def self.[](name)
  all[name.to_sym]
end

.add(name, &block) ⇒ Object



7
8
9
# File 'lib/yawl/process_definitions.rb', line 7

def self.add(name, &block)
  all[name.to_sym] = block
end

.allObject



11
12
13
# File 'lib/yawl/process_definitions.rb', line 11

def self.all
  @all ||= {}
end

.all_namesObject



15
16
17
# File 'lib/yawl/process_definitions.rb', line 15

def self.all_names
  all.keys.map {|k| k.to_s }
end

.realize_on(name, process) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/yawl/process_definitions.rb', line 19

def self.realize_on(name, process)
  unless definition = self[name]
    raise "Can't find definition #{name}"
  end

  definition.call(process)
end