Class: Sinclair::MethodBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/sinclair/method_builder.rb,
lib/sinclair/method_builder/base.rb,
lib/sinclair/method_builder/block_method_builder.rb,
lib/sinclair/method_builder/string_method_builder.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.

Class responsible for building methods

Author:

  • darthjee

Defined Under Namespace

Classes: Base, BlockMethodBuilder, StringMethodBuilder

Constant Summary collapse

CLASS_METHOD =

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

:class
INSTANCE_METHOD =

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

:instance

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ MethodBuilder

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.

Returns a new instance of MethodBuilder.

Parameters:

  • klass (Class)

    class to receive the method



17
18
19
# File 'lib/sinclair/method_builder.rb', line 17

def initialize(klass)
  @klass = klass
end

Instance Method Details

#build_methods(definitions, type) ⇒ MethodDefinitions

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 methods

Parameters:

  • definitions (MethodDefinitions)

    all methods definitions to be built

  • type (Symbol)

    type of method to be built

Returns:



28
29
30
31
32
# File 'lib/sinclair/method_builder.rb', line 28

def build_methods(definitions, type)
  definitions.each do |definition|
    build_from_definition(definition, type)
  end
end