Class: Sinclair::MethodBuilder::Base Private

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

Base class responsible for building methods

Direct Known Subclasses

BlockMethodBuilder, StringMethodBuilder

Instance Method Summary collapse

Constructor Details

#initialize(klass, definition, type:) ⇒ Base

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 Base.

Parameters:

  • klass (Class) —

    class to receive the method

  • definition (MethodDefinition) —

    method defined

  • type (Symbol) —

    type of method to be build

    • :instance instance methods
    • :class class methods


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

def initialize(klass, definition, type:)
  @klass = klass
  @definition = definition
  @type = type
end

Instance Method Details

#build ⇒ Symbol

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.

Build method (should be implemented in subclass)

Returns:

  • (Symbol) —

    name of the method built

Raises:

  • NotImplementedYet



26
27
28
# File 'lib/sinclair/method_builder/base.rb', line 26

def build
  raise 'Not implemented yet. this should be imlemented in subclasses'
end