Class: Rosette::Core::PathMatcherFactory::NotNode

Inherits:
UnaryNode
  • Object
show all
Defined in:
lib/rosette/core/path_matcher_factory.rb

Overview

A logical “NOT”.

Instance Attribute Summary

Attributes inherited from UnaryNode

#child

Instance Method Summary collapse

Methods inherited from UnaryNode

#initialize

Methods included from NodeOperatorFactory

#and, #not, #or

Methods included from NodeFactory

#match_file_extension, #match_file_extensions, #match_path, #match_paths, #match_regex, #match_regexes

Constructor Details

This class inherits a constructor from Rosette::Core::PathMatcherFactory::UnaryNode

Instance Method Details

#matches?(path) ⇒ Boolean

Determines if the given path does NOT match the child's conditions.

Parameters:

  • path (String)

    The path to match.

Returns:

  • (Boolean)

    true if the child does not match path, false otherwise.


221
222
223
# File 'lib/rosette/core/path_matcher_factory.rb', line 221

def matches?(path)
  !child.matches?(path)
end

#to_sString

Generates a string representation of this node.

Returns:

  • (String)

228
229
230
# File 'lib/rosette/core/path_matcher_factory.rb', line 228

def to_s
  "(NOT #{child.to_s})"
end