Class: Protoform::Node
- Inherits:
-
Object
- Object
- Protoform::Node
- Defined in:
- lib/protoform/node.rb
Overview
Superclass for Namespace and Field classes. Not much to it other than it has a ‘name` and `parent` node attribute. Think of it as a tree.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(key, parent:) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(key, parent:) ⇒ Node
Returns a new instance of Node.
9 10 11 12 |
# File 'lib/protoform/node.rb', line 9 def initialize(key, parent:) @key = key @parent = parent end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/protoform/node.rb', line 7 def key @key end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/protoform/node.rb', line 7 def parent @parent end |