Class: CSS::Position

Inherits:
Data
  • Object
show all
Defined in:
lib/css/token.rb

Overview

Source location of a token within the preprocessed input. ‘offset` and `end_offset` are 0-based character indices; `line` and `column` are 1-based.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



5
6
7
# File 'lib/css/token.rb', line 5

def column
  @column
end

#end_offsetObject (readonly)

Returns the value of attribute end_offset

Returns:

  • (Object)

    the current value of end_offset



5
6
7
# File 'lib/css/token.rb', line 5

def end_offset
  @end_offset
end

#lineObject (readonly)

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



5
6
7
# File 'lib/css/token.rb', line 5

def line
  @line
end

#offsetObject (readonly)

Returns the value of attribute offset

Returns:

  • (Object)

    the current value of offset



5
6
7
# File 'lib/css/token.rb', line 5

def offset
  @offset
end

Instance Method Details

#to_sObject



6
7
8
# File 'lib/css/token.rb', line 6

def to_s
  "#{line}:#{column}"
end