Class: Superform::Node

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



67
68
69
70
# File 'lib/superform.rb', line 67

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

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



65
66
67
# File 'lib/superform.rb', line 65

def key
  @key
end

#parentObject (readonly)

Returns the value of attribute parent.



65
66
67
# File 'lib/superform.rb', line 65

def parent
  @parent
end