Class: SassC::ImportHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/sassc/import_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ImportHandler

Returns a new instance of ImportHandler.



5
6
7
8
9
10
11
# File 'lib/sassc/import_handler.rb', line 5

def initialize(options)
  @importer = if options[:importer]
    options[:importer].new(options)
  else
    nil
  end
end

Instance Method Details

#setup(native_options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/sassc/import_handler.rb', line 13

def setup(native_options)
  return unless @importer

  importer_callback = Native.make_importer(import_function, nil)

  list = Native.make_function_list(1)
  Native::function_set_list_entry(list, 0, importer_callback)

  Native.option_set_c_importers(native_options, list)
end