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
#format, #pretty_print, #skip?, #without_new_line
Constructor Details
#initialize(opening:, contents:, closing:, location:) ⇒ HtmlString
Returns a new instance of HtmlString.
555 556 557 558 559 560 |
# File 'lib/syntax_tree/erb/nodes.rb', line 555 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.
553 554 555 |
# File 'lib/syntax_tree/erb/nodes.rb', line 553 def closing @closing end |
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
553 554 555 |
# File 'lib/syntax_tree/erb/nodes.rb', line 553 def contents @contents end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
553 554 555 |
# File 'lib/syntax_tree/erb/nodes.rb', line 553 def location @location end |
#opening ⇒ Object (readonly)
Returns the value of attribute opening.
553 554 555 |
# File 'lib/syntax_tree/erb/nodes.rb', line 553 def opening @opening end |
Instance Method Details
#accept(visitor) ⇒ Object
562 563 564 |
# File 'lib/syntax_tree/erb/nodes.rb', line 562 def accept(visitor) visitor.visit_html_string(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
566 567 568 |
# File 'lib/syntax_tree/erb/nodes.rb', line 566 def child_nodes [*contents] end |
#deconstruct_keys(keys) ⇒ Object
572 573 574 575 576 577 578 579 |
# File 'lib/syntax_tree/erb/nodes.rb', line 572 def deconstruct_keys(keys) { opening: opening, contents: contents, closing: closing, location: location } end |