Class: SyntaxTree::ERB::Doctype
- Defined in:
- lib/syntax_tree/erb/nodes.rb
Overview
A document type declaration is a special kind of tag that specifies the type of the document. It contains an opening declaration, the name of the document type, an optional external identifier, and a closing of the tag.
Instance Attribute Summary collapse
-
#closing ⇒ Object
readonly
Returns the value of attribute closing.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#opening ⇒ Object
readonly
Returns the value of attribute opening.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening:, name:, closing:, location:) ⇒ Doctype
constructor
A new instance of Doctype.
Methods inherited from Node
Constructor Details
#initialize(opening:, name:, closing:, location:) ⇒ Doctype
Returns a new instance of Doctype.
500 501 502 503 504 505 |
# File 'lib/syntax_tree/erb/nodes.rb', line 500 def initialize(opening:, name:, closing:, location:) @opening = opening @name = name @closing = closing @location = location end |
Instance Attribute Details
#closing ⇒ Object (readonly)
Returns the value of attribute closing.
498 499 500 |
# File 'lib/syntax_tree/erb/nodes.rb', line 498 def closing @closing end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
498 499 500 |
# File 'lib/syntax_tree/erb/nodes.rb', line 498 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
498 499 500 |
# File 'lib/syntax_tree/erb/nodes.rb', line 498 def name @name end |
#opening ⇒ Object (readonly)
Returns the value of attribute opening.
498 499 500 |
# File 'lib/syntax_tree/erb/nodes.rb', line 498 def opening @opening end |
Instance Method Details
#accept(visitor) ⇒ Object
507 508 509 |
# File 'lib/syntax_tree/erb/nodes.rb', line 507 def accept(visitor) visitor.visit_doctype(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
511 512 513 |
# File 'lib/syntax_tree/erb/nodes.rb', line 511 def child_nodes [opening, name, closing].compact end |
#deconstruct_keys(keys) ⇒ Object
517 518 519 |
# File 'lib/syntax_tree/erb/nodes.rb', line 517 def deconstruct_keys(keys) { opening: opening, name: name, closing: closing, location: location } end |