Class: SixthSense::SourceLocation

Inherits:
Struct
  • Object
show all
Defined in:
lib/sixth_sense/source_location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnObject

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



4
5
6
# File 'lib/sixth_sense/source_location.rb', line 4

def column
  @column
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



4
5
6
# File 'lib/sixth_sense/source_location.rb', line 4

def line
  @line
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



4
5
6
# File 'lib/sixth_sense/source_location.rb', line 4

def path
  @path
end

Instance Method Details

#to_hObject



5
6
7
8
9
10
11
# File 'lib/sixth_sense/source_location.rb', line 5

def to_h
  {
    path: path,
    line: line,
    column: column
  }
end

#to_sObject



13
14
15
16
17
# File 'lib/sixth_sense/source_location.rb', line 13

def to_s
  return path.to_s unless line

  [path, line, column].compact.join(":")
end