Module: AssemblyLine::Registry
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 |
#clear ⇒ Object
17 18 19 |
# File 'lib/assembly_line/registry.rb', line 17 def clear constructors.clear end |
#list ⇒ Object
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 |