Class: PredicateFunction

Inherits:
Proc
  • Object
show all
Defined in:
lib/totally_lazy/predicates.rb

Instance Method Summary collapse

Methods inherited from Proc

#*, #and_then, compose, #optional, #or_exception

Instance Method Details

#and(other) ⇒ Object



32
33
34
# File 'lib/totally_lazy/predicates.rb', line 32

def and(other)
  ->(value) { self.(value) && other.(value) }
end

#or(other) ⇒ Object



36
37
38
# File 'lib/totally_lazy/predicates.rb', line 36

def or(other)
  ->(value) { self.(value) || other.(value) }
end