Class: SassC::Script::ValueConversion::Map

Inherits:
Base
  • Object
show all
Defined in:
lib/sassc/script/value_conversion/map.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SassC::Script::ValueConversion::Base

Instance Method Details

#to_nativeObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/sassc/script/value_conversion/map.rb', line 7

def to_native
  hash = @value.to_h
  native_map = Native::make_map( hash.size )
  hash.each_with_index do |(key, value), index|
    key   = ValueConversion.to_native key
    value = ValueConversion.to_native value
    Native::map_set_key(   native_map, index, key )
    Native::map_set_value( native_map, index, value )
  end
  return native_map
end