123456789_123456789_123456789_123456789_123456789_

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

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(location) ⇒ LocationTarget

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 56

def initialize(location)
  @location = location
end

Instance Attribute Details

#location (readonly)

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 54

attr_reader :location

Instance Method Details

#encloses?(comment) ⇒ Boolean

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 68

def encloses?(comment)
  false
end

#end_offset

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 64

def end_offset
  location.end_offset
end

#leading_comment(comment)

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 72

def leading_comment(comment)
  location.leading_comment(comment)
end

#start_offset

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 60

def start_offset
  location.start_offset
end

#trailing_comment(comment)

[ GitHub ]

  
# File 'lib/prism/parse_result/comments.rb', line 76

def trailing_comment(comment)
  location.trailing_comment(comment)
end