Class: Regexp::NegRegexp

Inherits:
Object show all
Defined in:
lib/functional.rb

Instance Method Summary collapse

Constructor Details

#initialize(r) ⇒ NegRegexp

Returns a new instance of NegRegexp.



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

def initialize r
  @rx = r
end

Instance Method Details

#-@Object



13
14
15
# File 'lib/functional.rb', line 13

def -@
  @rx
end

#=~(l) ⇒ Object



10
11
12
# File 'lib/functional.rb', line 10

def =~ l
  ! @rx =~ l
end

#match(l) ⇒ Object



7
8
9
# File 'lib/functional.rb', line 7

def match l
  ! @rx.match( l)
end