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/call_method_builder.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, CallMethodBuilder, 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 Attribute Summary collapse

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



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

def initialize(klass)
  @klass = klass
end

Instance Attribute Details

#klassClass (readonly)

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.

class to receive the method

Returns:

  • (Class)


47
48
49
# File 'lib/sinclair/method_builder.rb', line 47

def 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:

Returns:



31
32
33
34
35
# File 'lib/sinclair/method_builder.rb', line 31

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