Module: Sinclair::ClassMethods
- Included in:
- Sinclair
- Defined in:
- lib/sinclair/class_methods.rb
Overview
Class methods for Sinclair
Instance Method Summary collapse
-
#build(*args, **opts, &block) { ... } ⇒ Array<MethodDefinition>
Runs build using a block for adding the methods.
Instance Method Details
#build(*args, **opts, &block) { ... } ⇒ Array<MethodDefinition>
Runs build using a block for adding the methods
The block is executed adding the methods and after the builder runs build building all the methods
35 36 37 38 39 |
# File 'lib/sinclair/class_methods.rb', line 35 def build(*args, **opts, &block) new(*args, **opts).tap do |builder| builder.instance_eval(&block) if block_given? end.build end |