Module: RFunk::AttributeFunction

Defined in:
lib/rfunk/attribute/attribute_function.rb

Instance Method Summary collapse

Instance Method Details

#fun(definition, &block) ⇒ Object Also known as: fn, func, defn


3
4
5
6
7
8
# File 'lib/rfunk/attribute/attribute_function.rb', line 3

def fun(definition, &block)
  function_definition = function_definition(definition)
  lambda = ->(*args) { RFunk::Function.new(self, function_definition, &block).execute(*args) }

  define_method function_definition.value(0).value, &lambda
end