Class: Case::Predicate

Inherits:
Object
  • Object
show all
Defined in:
lib/case.rb

Instance Method Summary collapse

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