Class: Rosette::Core::PathMatcherFactory::UnaryNode

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

Overview

The base class for all nodes that perform unary operations (i.e. operations that take only one operand).

Direct Known Subclasses

NotNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#matches?

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

#initialize(child) ⇒ UnaryNode

Creates a new unary node.

Parameters:

  • child (Node)

    The child.


169
170
171
# File 'lib/rosette/core/path_matcher_factory.rb', line 169

def initialize(child)
  @child = child
end

Instance Attribute Details

#childNode (readonly)

Returns the child node.

Returns:

  • (Node)

    the child node.


163
164
165
166
167
168
169
170
171
172
# File 'lib/rosette/core/path_matcher_factory.rb', line 163

class UnaryNode < Node
  attr_reader :child

  # Creates a new unary node.
  #
  # @param [Node] child The child.
  def initialize(child)
    @child = child
  end
end