Class: Yoda::AST::CommentBlock::TagTextNamePart
- Inherits:
-
BasePart
- Object
- BasePart
- Yoda::AST::CommentBlock::TagTextNamePart
show all
- Defined in:
- lib/yoda/ast/comment_block/tag_text_name_part.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#begin_location, #end_location, #include?, #range, #text
Constructor Details
#initialize(parent:, tokens:) ⇒ TagTextNamePart
Returns a new instance of TagTextNamePart.
13
14
15
16
|
# File 'lib/yoda/ast/comment_block/tag_text_name_part.rb', line 13
def initialize(parent:, tokens:)
@parent = parent
@tokens = tokens
end
|
Instance Attribute Details
6
7
8
|
# File 'lib/yoda/ast/comment_block/tag_text_name_part.rb', line 6
def parent
@parent
end
|
#tokens ⇒ Array<Parslet::Slice>
9
10
11
|
# File 'lib/yoda/ast/comment_block/tag_text_name_part.rb', line 9
def tokens
@tokens
end
|
Instance Method Details
#begin_index ⇒ Integer
24
25
26
|
# File 'lib/yoda/ast/comment_block/tag_text_name_part.rb', line 24
def begin_index
tokens.first.offset
end
|
19
20
21
|
# File 'lib/yoda/ast/comment_block/tag_text_name_part.rb', line 19
def
parent.
end
|
#end_index ⇒ Integer
29
30
31
|
# File 'lib/yoda/ast/comment_block/tag_text_name_part.rb', line 29
def end_index
tokens.last.offset + tokens.last.length
end
|