Module: Axiom::Function::Unary::Callable
- Included in:
- Axiom::Function::Unary
- Defined in:
- lib/axiom/function/unary.rb
Overview
Mixin for adding #call to unary function classes
Instance Method Summary collapse
-
#call(value) ⇒ Object
Return the response from the unary operation called on the value.
-
#included(descendant) ⇒ self
private
Hook called when module is included.
Instance Method Details
#call(value) ⇒ Object
Return the response from the unary operation called on the value
38 39 40 |
# File 'lib/axiom/function/unary.rb', line 38 def call(value) value.public_send(operation) end |
#included(descendant) ⇒ self
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.
Hook called when module is included
22 23 24 25 26 |
# File 'lib/axiom/function/unary.rb', line 22 def included(descendant) super descendant.extend(Callable) self end |