Class: Case::Guard

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

Instance Method Summary collapse

Constructor Details

#initialize(&predicate) ⇒ Guard

Returns a new instance of Guard.



79
80
81
# File 'lib/case.rb', line 79

def initialize(&predicate)
  @predicate = predicate
end

Instance Method Details

#===(obj) ⇒ Object



83
84
85
# File 'lib/case.rb', line 83

def ===(obj)
  @predicate.call obj
end