Sha256: 07a153d029eae051b563f995898e0fc20c675e5e7ab59e44b525fe223630d314

Contents?: true

Size: 801 Bytes

Versions: 6

Compression:

Stored size: 801 Bytes

Contents

# frozen_string_literal: true

module Phlexi
  module Field
    module Structure
      # Superclass for Namespace and Field classes. Represents a node in the field tree structure.
      #
      # @attr_reader [Symbol] key The node's key
      # @attr_reader [Node, nil] parent The node's parent in the tree structure
      class Node
        attr_reader :key, :parent

        # Initializes a new Node instance.
        #
        # @param key [Symbol, String] The key for the node
        # @param parent [Node, nil] The parent node
        def initialize(key, parent:)
          @key = :"#{key}"
          @parent = parent
        end

        def inspect
          "<#{self.class.name} key=#{key.inspect} object=#{object.inspect} parent=#{parent.inspect} />"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
phlexi-field-0.0.11 lib/phlexi/field/structure/node.rb
phlexi-field-0.0.10 lib/phlexi/field/structure/node.rb
phlexi-field-0.0.9 lib/phlexi/field/structure/node.rb
phlexi-field-0.0.8 lib/phlexi/field/structure/node.rb
phlexi-field-0.0.7 lib/phlexi/field/structure/node.rb
phlexi-field-0.0.6 lib/phlexi/field/structure/node.rb