Class: Prism::ParseResult::Comments::LocationTarget
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/prism/parse_result/comments.rb |
Overview
A target for attaching comments that is based on a location field on a node. For example, the end token of a ClassNode.
Class Method Summary
-
.new(location) ⇒ LocationTarget
constructor
: (Location location) -> void.
Instance Attribute Summary
- #location readonly
Instance Method Summary
-
#encloses?(comment) ⇒ Boolean
: (Comment comment) -> bool.
-
#end_offset
: () -> Integer.
-
#leading_comment(comment)
: (Comment comment) -> void.
-
#start_offset
: () -> Integer.
-
#trailing_comment(comment)
: (Comment comment) -> void.
Constructor Details
.new(location) ⇒ LocationTarget
: (Location location) -> void
Instance Attribute Details
#location (readonly)
[ GitHub ]# File 'lib/prism/parse_result/comments.rb', line 74
attr_reader :location #: Location
Instance Method Details
#encloses?(comment) ⇒ Boolean
: (Comment comment) -> bool
# File 'lib/prism/parse_result/comments.rb', line 92
def encloses?(comment) false end
#end_offset
: () -> Integer
# File 'lib/prism/parse_result/comments.rb', line 87
def end_offset location.end_offset end
#leading_comment(comment)
: (Comment comment) -> void
# File 'lib/prism/parse_result/comments.rb', line 97
def leading_comment(comment) location.leading_comment(comment) end
#start_offset
: () -> Integer
# File 'lib/prism/parse_result/comments.rb', line 82
def start_offset location.start_offset end
#trailing_comment(comment)
: (Comment comment) -> void
# File 'lib/prism/parse_result/comments.rb', line 102
def trailing_comment(comment) location.trailing_comment(comment) end