class Solargraph::Location

A section of text identified by its filename and range.

Attributes

filename[R]

@return [String]

range[R]

@return [Solargraph::Range]

Public Class Methods

new(filename, range) click to toggle source

@param filename [String] @param range [Solargraph::Range]

# File lib/solargraph/location.rb, line 15
def initialize filename, range
  @filename = filename
  @range = range
end

Public Instance Methods

==(other) click to toggle source
# File lib/solargraph/location.rb, line 28
def == other
  return false unless other.is_a?(Location)
  filename == other.filename and range == other.range
end
inspect() click to toggle source
# File lib/solargraph/location.rb, line 33
def inspect
  "#<#{self.class} #{filename}, #{range.inspect}>"
end
to_hash() click to toggle source

@return [Hash]

# File lib/solargraph/location.rb, line 21
def to_hash
  {
    filename: filename,
    range: range.to_hash
  }
end