Class: SyntaxTree::EmbDoc
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::EmbDoc
show all
- Defined in:
- lib/syntax_tree/node.rb
Overview
EmbDoc represents a multi-line comment.
Instance Attribute Summary collapse
Attributes inherited from Node
#location
Instance Method Summary
collapse
Methods inherited from Node
#construct_keys, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ EmbDoc
Returns a new instance of EmbDoc.
4183
4184
4185
4186
|
# File 'lib/syntax_tree/node.rb', line 4183
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
- String
-
the contents of the comment
4181
4182
4183
|
# File 'lib/syntax_tree/node.rb', line 4181
def value
@value
end
|
Instance Method Details
#accept(visitor) ⇒ Object
4200
4201
4202
|
# File 'lib/syntax_tree/node.rb', line 4200
def accept(visitor)
visitor.visit_embdoc(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
4204
4205
4206
|
# File 'lib/syntax_tree/node.rb', line 4204
def child_nodes
[]
end
|
4196
4197
4198
|
# File 'lib/syntax_tree/node.rb', line 4196
def
[]
end
|
#deconstruct_keys(_keys) ⇒ Object
4210
4211
4212
|
# File 'lib/syntax_tree/node.rb', line 4210
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|
4214
4215
4216
4217
|
# File 'lib/syntax_tree/node.rb', line 4214
def format(q)
q.trim
q.text(value)
end
|
#ignore? ⇒ Boolean
4192
4193
4194
|
# File 'lib/syntax_tree/node.rb', line 4192
def ignore?
false
end
|
#inline? ⇒ Boolean
4188
4189
4190
|
# File 'lib/syntax_tree/node.rb', line 4188
def inline?
false
end
|