Class: RegOr

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

Overview

this is just a proof of concept toy.

Instance Method Summary collapse

Constructor Details

#initialize(re1, re2) ⇒ RegOr

Returns a new instance of RegOr.


4
5
6
7
# File 'lib/eregex.rb', line 4

def initialize(re1, re2)
  @re1 = re1
  @re2 = re2
end

Instance Method Details

#=~(str) ⇒ Object


9
10
11
# File 'lib/eregex.rb', line 9

def =~ (str)
  @re1 =~ str or @re2 =~ str
end