Class: Sass::Source::Range

Inherits:
Object
  • Object
show all
Defined in:
lib/sass/source/range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_pos, end_pos, file, importer = nil) ⇒ Range

Returns a new instance of Range.

Parameters:



29
30
31
32
33
34
# File 'lib/sass/source/range.rb', line 29

def initialize(start_pos, end_pos, file, importer = nil)
  @start_pos = start_pos
  @end_pos = end_pos
  @file = file
  @importer = importer
end

Instance Attribute Details

#end_posSass::Source::Position

The ending position of the range in the document (exclusive).



11
12
13
# File 'lib/sass/source/range.rb', line 11

def end_pos
  @end_pos
end

#fileString

The file in which this source range appears. This can be nil if the file is unknown or not yet generated.

Returns:

  • (String)


17
18
19
# File 'lib/sass/source/range.rb', line 17

def file
  @file
end

#importerSass::Importers::Base

The importer that imported the file in which this source range appears. This is nil for target ranges.



23
24
25
# File 'lib/sass/source/range.rb', line 23

def importer
  @importer
end

#start_posSass::Source::Position

The starting position of the range in the document (inclusive).



6
7
8
# File 'lib/sass/source/range.rb', line 6

def start_pos
  @start_pos
end

Instance Method Details

#inspectString

Returns A string representation of the source range.

Returns:

  • (String)

    A string representation of the source range.



37
38
39
# File 'lib/sass/source/range.rb', line 37

def inspect
  "(#{start_pos.inspect} to #{end_pos.inspect}#{" in #{@file}" if @file})"
end