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.
4074 4075 4076 4077 |
# File 'lib/syntax_tree/node.rb', line 4074 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the contents of the comment
4072 4073 4074 |
# File 'lib/syntax_tree/node.rb', line 4072 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
4091 4092 4093 |
# File 'lib/syntax_tree/node.rb', line 4091 def accept(visitor) visitor.visit_embdoc(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
4095 4096 4097 |
# File 'lib/syntax_tree/node.rb', line 4095 def child_nodes [] end |
#comments ⇒ Object
4087 4088 4089 |
# File 'lib/syntax_tree/node.rb', line 4087 def comments [] end |
#deconstruct_keys(keys) ⇒ Object
4101 4102 4103 |
# File 'lib/syntax_tree/node.rb', line 4101 def deconstruct_keys(keys) { value: value, location: location } end |
#format(q) ⇒ Object
4105 4106 4107 4108 |
# File 'lib/syntax_tree/node.rb', line 4105 def format(q) q.trim q.text(value) end |
#ignore? ⇒ Boolean
4083 4084 4085 |
# File 'lib/syntax_tree/node.rb', line 4083 def ignore? false end |
#inline? ⇒ Boolean
4079 4080 4081 |
# File 'lib/syntax_tree/node.rb', line 4079 def inline? false end |