Class: Rubylog::Primitive
- Defined in:
- lib/rubylog/primitive.rb
Instance Attribute Summary
Attributes inherited from Predicate
Instance Method Summary collapse
-
#call(*args) ⇒ Object
calls the callable with the argumens.
-
#initialize(functor, callable) ⇒ Primitive
constructor
A new instance of Primitive.
Methods inherited from Predicate
Constructor Details
#initialize(functor, callable) ⇒ Primitive
Returns a new instance of Primitive.
4 5 6 7 |
# File 'lib/rubylog/primitive.rb', line 4 def initialize functor, callable super functor, callable.arity @callable = callable end |
Instance Method Details
#call(*args) ⇒ Object
calls the callable with the argumens
10 11 12 |
# File 'lib/rubylog/primitive.rb', line 10 def call *args @callable.call(*args) { yield } end |