Class: Sass::Source::Range

Inherits:
Object
  • Object
show all
Defined in:
/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/source/range.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Range) initialize(start_pos, end_pos, file, importer = nil)

Returns a new instance of Range

Parameters:



29
30
31
32
33
34
# File '/Users/ceppstei/Projects/sass-lang/.sass/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

- (Sass::Source::Position) end_pos

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



11
12
13
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/source/range.rb', line 11

def end_pos
  @end_pos
end

- (String) file

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 '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/source/range.rb', line 17

def file
  @file
end

- (Sass::Importers::Base) importer

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



23
24
25
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/source/range.rb', line 23

def importer
  @importer
end

- (Sass::Source::Position) start_pos

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



6
7
8
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/source/range.rb', line 6

def start_pos
  @start_pos
end

Instance Method Details

- (String) inspect

Returns A string representation of the source range.

Returns:

  • (String)

    A string representation of the source range.



37
38
39
# File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/source/range.rb', line 37

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