Class: Protoform::Node

Inherits:
Object
  • Object
show all
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

Field, Namespace, NamespaceCollection

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



7
8
9
# File 'lib/protoform/node.rb', line 7

def key
  @key
end

#parentObject (readonly)

Returns the value of attribute parent.



7
8
9
# File 'lib/protoform/node.rb', line 7

def parent
  @parent
end