Sha256: 76a52dee1050fcfaf60c913e589bd15a46767b8681417b98496f0fcd9682eaaf

Contents?: true

Size: 279 Bytes

Versions: 4

Compression:

Stored size: 279 Bytes

Contents

# frozen_string_literal: true

Array.class_eval do
  # Flattens and compacts an array
  # @see Array#flatten!
  # @see Array#compact!
  #
  # @return [Array]
  #
  def flatten_compact!
    flatten!

    compact!

    self
  end

  alias_method :flat_pact!, :flatten_compact!
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/flatten_compact.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/flatten_compact.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/flatten_compact.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/flatten_compact.rb