Sha256: 571c066134879ff38af067bfecd1ca5a29c29f7dfcbc3ebf5e04d57b4b546d6b

Contents?: true

Size: 251 Bytes

Versions: 11

Compression:

Stored size: 251 Bytes

Contents

# frozen_string_literal: true

module Refinements
  # Refinements for Arrays.
  module Arrays
    refine Array do
      def compress
        compact.reject(&:empty?)
      end

      def compress!
        replace(compress)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinements-5.1.0 lib/refinements/arrays.rb
refinements-5.0.2 lib/refinements/arrays.rb
refinements-5.0.1 lib/refinements/arrays.rb
refinements-4.3.1 lib/refinements/arrays.rb
refinements-4.3.0 lib/refinements/arrays.rb
refinements-4.2.0 lib/refinements/arrays.rb
refinements-4.1.0 lib/refinements/arrays.rb
refinements-4.0.0 lib/refinements/arrays.rb
refinements-3.2.0 lib/refinements/arrays.rb
refinements-3.1.0 lib/refinements/arrays.rb
refinements-3.0.0 lib/refinements/arrays.rb