class Infoboxer::Tree::Var

Template variable.

It's basically the thing with name and ANY nodes inside, can be seen only as a direct child of {Template}.

Attributes

name[R]

Public Class Methods

new(name, children = Nodes[]) click to toggle source
Calls superclass method Infoboxer::Tree::Compound::new
# File lib/infoboxer/tree/template.rb, line 14
def initialize(name, children = Nodes[])
  super(children)
  @name = name
end

Public Instance Methods

empty?() click to toggle source

Internal, used by {Parser} Means even children-less Var should not be removed from parser tree.

# File lib/infoboxer/tree/template.rb, line 21
def empty?
  false
end
named?() click to toggle source
# File lib/infoboxer/tree/template.rb, line 25
def named?
  name !~ /^\d+$/
end

Protected Instance Methods

_eq(other) click to toggle source
# File lib/infoboxer/tree/template.rb, line 35
def _eq(other)
  other.name == name && other.children == children
end
descr() click to toggle source
# File lib/infoboxer/tree/template.rb, line 31
def descr
  "#{clean_class}(#{name})"
end