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 52

def initialize(location)
  @location = location
end

Instance Attribute Details

#location (readonly)

[ GitHub ]

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

attr_reader :location

Instance Method Details

#<<(comment)

[ GitHub ]

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

def <<(comment)
  location.comments << comment
end

#encloses?(comment) ⇒ Boolean

[ GitHub ]

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

def encloses?(comment)
  false
end

#end_offset

[ GitHub ]

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

def end_offset
  location.end_offset
end

#start_offset

[ GitHub ]

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

def start_offset
  location.start_offset
end