Class: Case::Any

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

Overview

Pattern-matching disjunction

Instance Method Summary collapse

Constructor Details

#initialize(*options) ⇒ Any

Returns a new instance of Any.



25
26
27
# File 'lib/case.rb', line 25

def initialize(*options)
  @options = options
end

Instance Method Details

#===(obj) ⇒ Object



33
34
35
# File 'lib/case.rb', line 33

def ===(obj)
  @options.any? { |e| e === obj }
end

#optionsObject



29
30
31
# File 'lib/case.rb', line 29

def options
  @options.dup
end