Class: Lab42::Functor

Inherits:
BasicObject
Defined in:
lib/lab42/functor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#functionObject (readonly)

Returns the value of attribute function.



4
5
6
# File 'lib/lab42/functor.rb', line 4

def function
  @function
end

#resultObject (readonly)

Returns the value of attribute result.



4
5
6
# File 'lib/lab42/functor.rb', line 4

def result
  @result
end

Instance Method Details

#call(*args) ⇒ Object



7
8
9
# File 'lib/lab42/functor.rb', line 7

def call *args
  @result = function.(*args)
end

#inspectObject



11
12
13
# File 'lib/lab42/functor.rb', line 11

def inspect
  result.to_s
end