Class: RedSnow::Sourcemap::SourceMap

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

Instance Method Summary collapse

Constructor Details

#initialize(sc_source_map_handle) ⇒ SourceMap

Returns a new instance of SourceMap.



14
15
16
17
18
19
20
21
22
23
# File 'lib/redsnow/sourcemap.rb', line 14

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

  for index in 0..source_map_size do
    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