Sha256: 5ab631b6b02219fe051cdce01bd4202eef67678f1ca087c883c004bc0fa04f50
Contents?: true
Size: 513 Bytes
Versions: 14
Compression:
Stored size: 513 Bytes
Contents
class Array # If any item in the array has the key == `key` true, otherwise false. # Of good use when writing specs. def has_hash_key?(key) self.each do |entity| return true if entity.has_key? key end return false end # If any item in the array has the value == `key` true, otherwise false # Of good use when writing specs. def has_hash_value?(key) self.each do |entity| entity.each_pair{|hash_key, value| return true if value == key} end return false end end
Version data entries
14 entries across 14 versions & 2 rubygems