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

: (Location location) -> void

[ GitHub ]

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

def initialize(location)
  @location = location
end

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

[ GitHub ]

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

def encloses?(comment)
  false
end

#end_offset

: () -> Integer

[ GitHub ]

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

def end_offset
  location.end_offset
end

#leading_comment(comment)

: (Comment comment) -> void

[ GitHub ]

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

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

#start_offset

: () -> Integer

[ GitHub ]

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

def start_offset
  location.start_offset
end

#trailing_comment(comment)

: (Comment comment) -> void

[ GitHub ]

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

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