Sha256: e70886a3ca6cce8c7f38cf904edc0ea3af0ee7954283f099cd416ae1c62ee320

Contents?: true

Size: 315 Bytes

Versions: 17

Compression:

Stored size: 315 Bytes

Contents

class Hash
  alias :+ :merge
  def -(thing_to_be_deleted)
    if thing_to_be_deleted.is_a? Hash
      thing_to_be_deleted.each do |key, value|
        self.delete(key) if self[key] == value
      end
    elsif self.keys.include? thing_to_be_deleted
      self.delete(thing_to_be_deleted)
    end
    self
  end
end

Version data entries

17 entries across 17 versions & 7 rubygems

Version Path
FreedomCoder-utility_belt-1.1.1.2 lib/utility_belt/hash_math.rb
FreedomCoder-utility_belt-1.1.1 lib/utility_belt/hash_math.rb
akitaonrails-utility_belt-1.0.10 lib/utility_belt/hash_math.rb
akitaonrails-utility_belt-1.0.11 lib/utility_belt/hash_math.rb
akitaonrails-utility_belt-1.0.12 lib/utility_belt/hash_math.rb
mguterl-utility_belt-1.0.7 lib/utility_belt/hash_math.rb
rwilcox-utility_belt-1.0.7 lib/utility_belt/hash_math.rb
rwilcox-utility_belt-1.0.9 lib/utility_belt/hash_math.rb
timocratic-utility_belt-1.0.7.1 lib/utility_belt/hash_math.rb
timocratic-utility_belt-1.0.7.2 lib/utility_belt/hash_math.rb
timocratic-utility_belt-1.0.7.3 lib/utility_belt/hash_math.rb
flyrb-1.0.0.c lib/flyrb/hash_math.rb
flyrb-1.0.0.b lib/flyrb/hash_math.rb
flyrb-1.0.0.a lib/flyrb/hash_math.rb
akitaonrails-utility_belt-1.0.13 lib/utility_belt/hash_math.rb
utility_belt-1.0.6 lib/hash_math.rb
utility_belt-1.0.5 lib/hash_math.rb