Sha256: bf315b2eb67f34973aa1a74e73ebfb097f8e4be94eac53249579f58f1c29bb05

Contents?: true

Size: 515 Bytes

Versions: 5

Compression:

Stored size: 515 Bytes

Contents

# frozen_string_literal: true

module SlimLint
  module Filters
    # A dumbed-down version of {Slim::Splat::Filter} which doesn't introduced
    # temporary variables or other cruft.
    class SplatProcessor < Filter
      # Handle slim splat expressions `[:slim, :splat, code]`
      #
      # @param code [String]
      # @return [Array]
      def on_slim_splat(code)
        return code if code[0] == :multi
        @self.delete_at(1)
        @self.first.value = :code
        @self
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slim_lint_standard-0.0.2.2 lib/slim_lint/filters/splat_processor.rb
slim_lint_standard-0.0.2.1 lib/slim_lint/filters/splat_processor.rb
slim_lint_standard-0.0.2 lib/slim_lint/filters/splat_processor.rb
slim_lint_standard-0.0.1 lib/slim_lint/filters/splat_processor.rb
slim_lint_standard-0.0.0 lib/slim_lint/filters/splat_processor.rb