class Spellr::ColumnLocation

Attributes

byte_offset[R]
char_offset[R]
line_location[RW]

Public Class Methods

new(char_offset: 0, byte_offset: 0, line_location: LineLocation.new) click to toggle source
# File lib/spellr/column_location.rb, line 11
def initialize(char_offset: 0, byte_offset: 0, line_location: LineLocation.new)
  @line_location = line_location
  @char_offset = char_offset
  @byte_offset = byte_offset
end

Public Instance Methods

absolute_byte_offset() click to toggle source
# File lib/spellr/column_location.rb, line 21
def absolute_byte_offset
  byte_offset + line_location.byte_offset
end
absolute_char_offset() click to toggle source
# File lib/spellr/column_location.rb, line 17
def absolute_char_offset
  char_offset + line_location.char_offset
end
coordinates() click to toggle source

:nocov:

# File lib/spellr/column_location.rb, line 43
def coordinates
  [line_number, char_offset]
end
file() click to toggle source
# File lib/spellr/column_location.rb, line 29
def file
  line_location.file
end
inspect() click to toggle source

:nocov:

# File lib/spellr/column_location.rb, line 38
def inspect
  "#<#{self.class.name} #{self}>"
end
line_number() click to toggle source
# File lib/spellr/column_location.rb, line 25
def line_number
  line_location.line_number
end
to_s() click to toggle source
# File lib/spellr/column_location.rb, line 33
def to_s
  "#{line_location}:#{char_offset}"
end