Sha256: a1ca111ddf64e848fe6ec40559cdbe62c583fcba176c9a2571b3b738d9be756a

Contents?: true

Size: 606 Bytes

Versions: 90

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

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

90 entries across 75 versions & 6 rubygems

Version Path
sassc-embedded-1.80.1 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.80.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.79.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.78.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.8 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.7 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.6 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.5 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.4 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.3 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.2 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.1 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.77.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.76.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.75.2 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.75.1 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.75.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.74.1 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb
sassc-embedded-1.74.0 vendor/github.com/sass/sassc-ruby/lib/sassc/script/value_conversion/list.rb