Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/hashtml/hash.rb

Instance Method Summary collapse

Instance Method Details

#include_pairs?(hash) ⇒ Boolean

Checks if an ‘hash’ is a subset of the object

Parameters:

  • hash (Hash)

    pairs to verify

Returns:

  • (Boolean)


7
8
9
# File 'lib/hashtml/hash.rb', line 7

def include_pairs?(hash)
  hash.select { |k, v| k if self[k] != v }.empty?
end