Module: AssemblyLine::Registry

Extended by:
Registry
Included in:
Registry
Defined in:
lib/assembly_line/registry.rb

Instance Method Summary collapse

Instance Method Details

#add(name, block) ⇒ Object



5
6
7
# File 'lib/assembly_line/registry.rb', line 5

def add(name, block)
  constructors[name] = Constructor.new(name, block)
end

#clearObject



17
18
19
# File 'lib/assembly_line/registry.rb', line 17

def clear
  constructors.clear
end

#listObject



9
10
11
# File 'lib/assembly_line/registry.rb', line 9

def list
  constructors.keys.dup
end

#locate(name) ⇒ Object



13
14
15
# File 'lib/assembly_line/registry.rb', line 13

def locate(name)
  constructors[name] || raise(ArgumentError, "AssemblyLine could not find definition for: '#{name.inspect}'")
end