Class: Ramda::Internal::Transducers::FilterTransducer
- Inherits:
-
Object
- Object
- Ramda::Internal::Transducers::FilterTransducer
- Defined in:
- lib/ramda/internal/transducers/filter_transdurer.rb
Overview
Filter list based on predicate which receives x
Instance Method Summary collapse
-
#call(predicate, reducer) ⇒ Object
predicate - fn with 1 arity.
Instance Method Details
#call(predicate, reducer) ⇒ Object
predicate - fn with 1 arity
7 8 9 10 11 12 13 14 15 |
# File 'lib/ramda/internal/transducers/filter_transdurer.rb', line 7 def call(predicate, reducer) lambda do |acc, x| if predicate.call(x) reducer.call(acc, x) else acc end end end |