Sha256: 4af46b9b98d1aab081b22f833d43379a062610648d24568ce70e94cbfbf86392

Contents?: true

Size: 364 Bytes

Versions: 25

Compression:

Stored size: 364 Bytes

Contents

require 'gorillib/object/blank'

class Array
  #
  # remove all key-value pairs where the value is blank
  #
  def compact_blank
    reject{|val| val.blank? }
  end unless method_defined?(:compact_blank)

  #
  # Replace the array with its compact_blank'ed self
  #
  def compact_blank!
    replace(compact_blank)
  end unless method_defined?(:compact_blank!)
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
gorillib-0.6.0 lib/gorillib/array/compact_blank.rb
gorillib-0.5.2 lib/gorillib/array/compact_blank.rb
gorillib-0.5.0 lib/gorillib/array/compact_blank.rb
gorillib-0.4.2 lib/gorillib/array/compact_blank.rb
gorillib-0.4.2pre lib/gorillib/array/compact_blank.rb
gorillib-0.4.0pre lib/gorillib/array/compact_blank.rb
gorillib-0.4.1pre lib/gorillib/array/compact_blank.rb
gorillib-0.1.11 lib/gorillib/array/compact_blank.rb
gorillib-0.1.9 lib/gorillib/array/compact_blank.rb
gorillib-0.1.8 lib/gorillib/array/compact_blank.rb
gorillib-0.1.7 lib/gorillib/array/compact_blank.rb
gorillib-0.1.6 lib/gorillib/array/compact_blank.rb
gorillib-0.1.5 lib/gorillib/array/compact_blank.rb
gorillib-0.1.4 lib/gorillib/array/compact_blank.rb
gorillib-0.1.3 lib/gorillib/array/compact_blank.rb
gorillib-0.1.2 lib/gorillib/array/compact_blank.rb
gorillib-0.1.1 lib/gorillib/array/compact_blank.rb
gorillib-0.1.0 lib/gorillib/array/compact_blank.rb
gorillib-0.0.8 lib/gorillib/array/compact_blank.rb
gorillib-0.0.7 lib/gorillib/array/compact_blank.rb