Class: Case::Predicate
- Inherits:
-
Object
- Object
- Case::Predicate
- Defined in:
- lib/case.rb
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(&predicate) ⇒ Predicate
constructor
A new instance of Predicate.
Constructor Details
#initialize(&predicate) ⇒ Predicate
Returns a new instance of Predicate.
57 58 59 |
# File 'lib/case.rb', line 57 def initialize(&predicate) @predicate = predicate end |
Instance Method Details
#===(other) ⇒ Object
61 62 63 |
# File 'lib/case.rb', line 61 def ===(other) @predicate.call other end |