Class: SassC::Script::ValueConversion::List

Inherits:
Base
  • Object
show all
Defined in:
lib/sassc/script/value_conversion/list.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



12
13
14
15
16
17
18
19
20
21
# File 'lib/sassc/script/value_conversion/list.rb', line 12

def to_native
  list = @value.to_a
  sep = SEPARATORS.fetch(@value.separator)
  native_list = Native::make_list(list.size, sep)
  list.each_with_index do |item, index|
    native_item = ValueConversion.to_native(item)
    Native::list_set_value(native_list, index, native_item)
  end
  native_list
end