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

Version Path
motion-support-1.2.1 motion/core_ext/array.rb
motion-support-1.1.1 motion/core_ext/array.rb
motion-support-1.2.0 motion/core_ext/array.rb
motion-support-1.1.0 motion/core_ext/array.rb
motion-support-1.0.0 motion/core_ext/array.rb
motion-support-0.3.0 motion/core_ext/array.rb
motion_blender-support-0.2.8 motion/core_ext/array.rb
motion_blender-support-0.2.7 motion/core_ext/array.rb
motion-support-0.2.6 motion/core_ext/array.rb
motion-support-0.2.5 motion/core_ext/array.rb
motion-support-0.2.4 motion/core_ext/array.rb
motion-support-0.2.3 motion/core_ext/array.rb
motion-support-0.2.2 motion/core_ext/array.rb
motion-support-0.2.0 motion/core_ext/array.rb