Class: Rux::AST::TagNode

Inherits:
Object
  • Object
show all
Defined in:
lib/rux/ast/tag_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attrs) ⇒ TagNode

Returns a new instance of TagNode.



6
7
8
9
10
# File 'lib/rux/ast/tag_node.rb', line 6

def initialize(name, attrs)
  @name = name
  @attrs = attrs
  @children = []
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



4
5
6
# File 'lib/rux/ast/tag_node.rb', line 4

def attrs
  @attrs
end

#childrenObject (readonly)

Returns the value of attribute children.



4
5
6
# File 'lib/rux/ast/tag_node.rb', line 4

def children
  @children
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rux/ast/tag_node.rb', line 4

def name
  @name
end

Instance Method Details

#accept(visitor) ⇒ Object



12
13
14
# File 'lib/rux/ast/tag_node.rb', line 12

def accept(visitor)
  visitor.visit_tag(self)
end

#component?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rux/ast/tag_node.rb', line 16

def component?
  name.start_with?(/[A-Z]/)
end