Class: Case::Any
- Inherits:
-
Object
- Object
- Case::Any
- Defined in:
- lib/case.rb
Overview
Pattern-matching disjunction
Instance Method Summary collapse
- #===(obj) ⇒ Object
-
#initialize(*options) ⇒ Any
constructor
A new instance of Any.
- #options ⇒ Object
Constructor Details
#initialize(*options) ⇒ Any
Returns a new instance of Any.
25 26 27 |
# File 'lib/case.rb', line 25 def initialize(*) @options = end |
Instance Method Details
#===(obj) ⇒ Object
33 34 35 |
# File 'lib/case.rb', line 33 def ===(obj) @options.any? { |e| e === obj } end |
#options ⇒ Object
29 30 31 |
# File 'lib/case.rb', line 29 def @options.dup end |