Class: Rosette::Core::PathMatcherFactory::BinaryNode
- Defined in:
- lib/rosette/core/path_matcher_factory.rb
Overview
The base class for all nodes that perform binary operations (i.e. operations that take two operands).
Instance Attribute Summary collapse
-
#left ⇒ Node
readonly
The left child.
-
#right ⇒ Node
readonly
The right child.
Instance Method Summary collapse
-
#initialize(left, right) ⇒ BinaryNode
constructor
Creates a new binary node with left and right children.
Methods inherited from Node
Methods included from NodeOperatorFactory
Methods included from NodeFactory
#match_file_extension, #match_file_extensions, #match_path, #match_paths, #match_regex, #match_regexes
Constructor Details
#initialize(left, right) ⇒ BinaryNode
Creates a new binary node with left and right children.
152 153 154 155 |
# File 'lib/rosette/core/path_matcher_factory.rb', line 152 def initialize(left, right) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Node (readonly)
Returns the left child.
145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/rosette/core/path_matcher_factory.rb', line 145 class BinaryNode < Node attr_reader :left, :right # Creates a new binary node with left and right children. # # @param [Node] left The left child. # @param [Node] right The right child. def initialize(left, right) @left = left @right = right end end |
#right ⇒ Node (readonly)
Returns the right child.
145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/rosette/core/path_matcher_factory.rb', line 145 class BinaryNode < Node attr_reader :left, :right # Creates a new binary node with left and right children. # # @param [Node] left The left child. # @param [Node] right The right child. def initialize(left, right) @left = left @right = right end end |