Method: Sinclair::MethodDefinitions#add
- Defined in:
- lib/sinclair/method_definitions.rb
#add(definition_class, name, code = nil, **options) ⇒ Array<MethodDefinition> #add(definition_class, name, **options, &block) ⇒ Array<MethodDefinition> #add(type, *args, **options, &block) ⇒ Array<MethodDefinition>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds and adds new definition
The type is decided based in the arguments
43 44 45 |
# File 'lib/sinclair/method_definitions.rb', line 43 def add(*args, type: nil, **, &block) definitions << MethodDefinition.for(type, *args, **, &block) end |