Class: Line::Matchers::Not
- Inherits:
-
Object
- Object
- Line::Matchers::Not
- Includes:
- Helpers
- Defined in:
- lib/line/matchers/not.rb
Instance Attribute Summary collapse
-
#matcher ⇒ Object
Returns the value of attribute matcher.
Instance Method Summary collapse
-
#initialize(matcher) ⇒ Not
constructor
A new instance of Not.
- #inspect(parent = false) ⇒ Object
- #matches?(line, positive_index, negative_index) ⇒ Boolean
Methods included from Helpers
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
#matcher ⇒ Object
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
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 |