Class: Sinclair::MethodDefinitions Private

Inherits:
Object
  • Object
show all
Defined in:
lib/sinclair/method_definitions.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Enumerator holding all method definitions

Author:

  • darthjee

Instance Method Summary collapse

Instance Method Details

#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

Overloads:

  • #add(definition_class, name, code = nil, **options) ⇒ Array<MethodDefinition>

    Options Hash (**options):

    • cached (Boolean) —

      Flag telling to create a method with cache

  • #add(definition_class, name, **options, &block) ⇒ Array<MethodDefinition>

    Options Hash (**options):

    • cached (Boolean) —

      Flag telling to create a method with cache

  • #add(type, *args, **options, &block) ⇒ Array<MethodDefinition>

    Options Hash (**options):

    • cached (Boolean) —

      Flag telling to create a method with cache

See Also:



43
44
45
# File 'lib/sinclair/method_definitions.rb', line 43

def add(*args, type: nil, **options, &block)
  definitions << MethodDefinition.for(type, *args, **options, &block)
end