Sha256: d4469e06f4ed8f0bbb10a8be0e1179636d6bc4de0b366385b819e115e5bff36e

Contents?: true

Size: 235 Bytes

Versions: 11

Compression:

Stored size: 235 Bytes

Contents

class Hash
  def assert_valid_keys(*valid_keys)
    each_key do |k|
      next if valid_keys.include?(k)
      raise ArgumentError, "unknown key: #{k.inspect}. valid keys are: #{valid_keys.map(&:inspect).join(', ')}"
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cronicle-0.2.5 lib/cronicle/ext/hash_ext.rb
cronicle-0.2.4 lib/cronicle/ext/hash_ext.rb
cronicle-0.2.3 lib/cronicle/ext/hash_ext.rb
cronicle-0.2.2 lib/cronicle/ext/hash_ext.rb
cronicle-0.2.1 lib/cronicle/ext/hash_ext.rb
cronicle-0.2.0 lib/cronicle/ext/hash_ext.rb
cronicle-0.1.9 lib/cronicle/ext/hash_ext.rb
cronicle-0.1.8 lib/cronicle/ext/hash_ext.rb
cronicle-0.1.7 lib/cronicle/ext/hash_ext.rb
cronicle-0.1.6 lib/cronicle/ext/hash_ext.rb
cronicle-0.1.5 lib/cronicle/ext/hash_ext.rb