Module: Nina::Builder::ClassMethods

Defined in:
lib/nina/builder.rb

Overview

Definaes support methods and variables for concrete builder

Instance Method Summary collapse

Instance Method Details

#factory(name, *args, **kwargs, &block) ⇒ Object



17
18
19
20
21
22
# File 'lib/nina/builder.rb', line 17

def factory(name, *args, **kwargs, &block)
  super
  define_singleton_method(name) do |klass = nil, &definition|
    factories[__method__].subclass(produces: klass, &definition)
  end
end