Sha256: 740d42cbb2ad44e53197f99cb1782eb8e992cd9991d3bed7492a3f13a06a0fa2

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

module SassC
  module Script
    module ValueConversion
      SEPARATORS = {
        space: :sass_space,
        comma: :sass_comma
      }

      class List < Base
        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
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sassc-1.12.1 lib/sassc/script/value_conversion/list.rb
sassc-1.12.0 lib/sassc/script/value_conversion/list.rb
sassc-1.11.4 lib/sassc/script/value_conversion/list.rb
sassc-1.11.3 lib/sassc/script/value_conversion/list.rb
sassc-1.11.2 lib/sassc/script/value_conversion/list.rb
sassc-1.11.1 lib/sassc/script/value_conversion/list.rb
sassc-1.11.0 lib/sassc/script/value_conversion/list.rb