Class: SyntaxTree::EmbDoc
Overview
EmbDoc represents a multi-line comment.
=begin
first line
second line
=end
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the contents of the comment.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #comments ⇒ Object
- #deconstruct_keys(keys) ⇒ Object
- #format(q) ⇒ Object
- #ignore? ⇒ Boolean
-
#initialize(value:, location:) ⇒ EmbDoc
constructor
A new instance of EmbDoc.
- #inline? ⇒ Boolean
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ EmbDoc
Returns a new instance of EmbDoc.
3719 3720 3721 3722 |
# File 'lib/syntax_tree/node.rb', line 3719 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the contents of the comment
3717 3718 3719 |
# File 'lib/syntax_tree/node.rb', line 3717 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
3736 3737 3738 |
# File 'lib/syntax_tree/node.rb', line 3736 def accept(visitor) visitor.visit_embdoc(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
3740 3741 3742 |
# File 'lib/syntax_tree/node.rb', line 3740 def child_nodes [] end |
#comments ⇒ Object
3732 3733 3734 |
# File 'lib/syntax_tree/node.rb', line 3732 def comments [] end |
#deconstruct_keys(keys) ⇒ Object
3746 3747 3748 |
# File 'lib/syntax_tree/node.rb', line 3746 def deconstruct_keys(keys) { value: value, location: location } end |
#format(q) ⇒ Object
3750 3751 3752 3753 |
# File 'lib/syntax_tree/node.rb', line 3750 def format(q) q.trim q.text(value) end |
#ignore? ⇒ Boolean
3728 3729 3730 |
# File 'lib/syntax_tree/node.rb', line 3728 def ignore? false end |
#inline? ⇒ Boolean
3724 3725 3726 |
# File 'lib/syntax_tree/node.rb', line 3724 def inline? false end |