Class: RedSnow::Sourcemap::SourceMap

Inherits:
Array
  • Object
show all
Defined in:
lib/redsnow/sourcemap.rb

Overview

SourceMap

Instance Method Summary collapse

Constructor Details

#initialize(sc_source_map_handle) ⇒ SourceMap

Returns a new instance of SourceMap.



11
12
13
14
15
16
17
18
19
20
# File 'lib/redsnow/sourcemap.rb', line 11

def initialize(sc_source_map_handle)
  source_map_size = RedSnow::Binding.sc_source_map_size(sc_source_map_handle) - 1

  (0..source_map_size).each do |index|
    location = RedSnow::Binding.sc_source_map_location(sc_source_map_handle, index)
    length = RedSnow::Binding.sc_source_map_length(sc_source_map_handle, index)

    self << [location, length]
  end
end