Method: Sinclair::MethodDefinition::CallDefinition#code_block

Defined in:
lib/sinclair/method_definition/call_definition.rb

#code_blockProc

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.

Block to be evaluated by the class when adding methods

The block will be a call from method_name passing arguments

as arguments

Returns:

  • (Proc)


28
29
30
31
32
33
34
35
# File 'lib/sinclair/method_definition/call_definition.rb', line 28

def code_block
  method_name = name
  args = arguments

  proc do
    send(method_name, *args)
  end
end