Class: SyntaxTree::ERB::HtmlString
- Defined in:
- lib/syntax_tree/erb/nodes.rb
Overview
A HtmlString can include ERB-tags
Instance Attribute Summary collapse
-
#closing ⇒ Object
readonly
Returns the value of attribute closing.
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#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:, contents:, closing:, location:) ⇒ HtmlString
constructor
A new instance of HtmlString.
Methods inherited from Node
Constructor Details
#initialize(opening:, contents:, closing:, location:) ⇒ HtmlString
Returns a new instance of HtmlString.
418 419 420 421 422 423 |
# File 'lib/syntax_tree/erb/nodes.rb', line 418 def initialize(opening:, contents:, closing:, location:) @opening = opening @contents = contents @closing = closing @location = location end |
Instance Attribute Details
#closing ⇒ Object (readonly)
Returns the value of attribute closing.
416 417 418 |
# File 'lib/syntax_tree/erb/nodes.rb', line 416 def closing @closing end |
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
416 417 418 |
# File 'lib/syntax_tree/erb/nodes.rb', line 416 def contents @contents end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
416 417 418 |
# File 'lib/syntax_tree/erb/nodes.rb', line 416 def location @location end |
#opening ⇒ Object (readonly)
Returns the value of attribute opening.
416 417 418 |
# File 'lib/syntax_tree/erb/nodes.rb', line 416 def opening @opening end |
Instance Method Details
#accept(visitor) ⇒ Object
425 426 427 |
# File 'lib/syntax_tree/erb/nodes.rb', line 425 def accept(visitor) visitor.visit_html_string(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
429 430 431 |
# File 'lib/syntax_tree/erb/nodes.rb', line 429 def child_nodes [*contents] end |
#deconstruct_keys(keys) ⇒ Object
435 436 437 438 439 440 441 442 |
# File 'lib/syntax_tree/erb/nodes.rb', line 435 def deconstruct_keys(keys) { opening: opening, contents: contents, closing: closing, location: location } end |