Class: Line::Matchers::Not

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/line/matchers/not.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#inspect_helper

Constructor Details

#initialize(matcher) ⇒ Not

Returns a new instance of Not.



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

def initialize(matcher)
  self.matcher = matcher
end

Instance Attribute Details

#matcherObject

Returns the value of attribute matcher.



8
9
10
# File 'lib/line/matchers/not.rb', line 8

def matcher
  @matcher
end

Instance Method Details

#inspect(parent = false) ⇒ Object



18
19
20
# File 'lib/line/matchers/not.rb', line 18

def inspect(parent=false)
  inspect_helper parent, "^#{matcher.inspect self}", true
end

#matches?(line, positive_index, negative_index) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/line/matchers/not.rb', line 14

def matches?(line, positive_index, negative_index)
  !matcher.matches?(line, positive_index, negative_index)
end