Class: Phlexi::Field::Structure::Node
- Inherits:
-
Object
- Object
- Phlexi::Field::Structure::Node
- Defined in:
- lib/phlexi/field/structure/node.rb
Overview
Superclass for Namespace and Field classes. Represents a node in the field tree structure.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Symbol
readonly
The node’s key.
-
#parent ⇒ Node?
readonly
The node’s parent in the tree structure.
Instance Method Summary collapse
-
#initialize(key, parent:) ⇒ Node
constructor
Initializes a new Node instance.
- #inspect ⇒ Object
Constructor Details
#initialize(key, parent:) ⇒ Node
Initializes a new Node instance.
17 18 19 20 |
# File 'lib/phlexi/field/structure/node.rb', line 17 def initialize(key, parent:) @key = :"#{key}" @parent = parent end |
Instance Attribute Details
#key ⇒ Symbol (readonly)
The node’s key
10 11 12 |
# File 'lib/phlexi/field/structure/node.rb', line 10 def key @key end |
#parent ⇒ Node? (readonly)
The node’s parent in the tree structure
10 11 12 |
# File 'lib/phlexi/field/structure/node.rb', line 10 def parent @parent end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/phlexi/field/structure/node.rb', line 22 def inspect "<#{self.class.name} key=#{key.inspect} object=#{object.inspect} parent=#{parent.inspect} />" end |