Class: Superform::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/superform/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.



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

def initialize(key, parent:)
  @key = key
  @parent = parent
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/superform/node.rb', line 5

def key
  @key
end

#parentObject (readonly)

Returns the value of attribute parent.



5
6
7
# File 'lib/superform/node.rb', line 5

def parent
  @parent
end