Module: Rosette::Core::PathMatcherFactory::NodeOperatorFactory

Included in:
Node
Defined in:
lib/rosette/core/path_matcher_factory.rb

Overview

Facilitates creating operator nodes that can perform binary operations, like “and”, “or”, and “not”.

Instance Method Summary collapse

Instance Method Details

#and(right) ⇒ AndNode

Creates an AndNode for combining two nodes together with a logical “and”.

Parameters:

  • right (Node)

    The other node. The left node is self.

Returns:

  • (AndNode)

    a node representing the logical “and” of self and right.


36
37
38
# File 'lib/rosette/core/path_matcher_factory.rb', line 36

def and(right)
  AndNode.new(self, right)
end

#notNotNode

Creates a Rosette::Core::PathMatcherFactory::NotNode for negating self.

Returns:

  • (NotNode)

    a node representing the negation of self.


43
44
45
# File 'lib/rosette/core/path_matcher_factory.rb', line 43

def not
  NotNode.new(self)
end

#or(right) ⇒ OrNode

Creates an OrNode for combining two nodes together with a logical “or”.

Parameters:

  • right (Node)

    The other node. The left node is self.

Returns:

  • (OrNode)

    a node representing the logical “or” of self and right.


26
27
28
# File 'lib/rosette/core/path_matcher_factory.rb', line 26

def or(right)
  OrNode.new(self, right)
end