Module: Functional
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #complement ⇒ Object
- #compose(other) ⇒ Object (also: #*)
- #identity ⇒ Object
- #pipe(other) ⇒ Object (also: #>>)
Instance Method Details
#complement ⇒ Object
19 20 21 |
# File 'lib/reducers/functional.rb', line 19 def complement lambda {|*args| not self.call(*args) } end |
#compose(other) ⇒ Object Also known as: *
23 24 25 |
# File 'lib/reducers/functional.rb', line 23 def compose(other) lambda {|*args| call(other.call(*args)) } end |
#identity ⇒ Object
3 4 5 |
# File 'lib/reducers/functional.rb', line 3 def identity ->x{ x} end |
#pipe(other) ⇒ Object Also known as: >>
27 28 29 |
# File 'lib/reducers/functional.rb', line 27 def pipe(other) other.compose(self) end |