Sha256: 83da2ac71bbef426a61f5951e75a7ba60c9c7523fe87fda052802abd3fc66b63

Contents?: true

Size: 289 Bytes

Versions: 6

Compression:

Stored size: 289 Bytes

Contents

require File.expand_path('../object', __FILE__)

class Hash
  def assert_valid_keys(*valid_keys)
    valid_keys.flatten!
    each_key {|k| raise(ArgumentError, "Unknown key #{k}") unless valid_keys.include?(k)}
  end

  def to_params
    collect{|k, v| v.to_query(k)}.sort * '&'
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
brandspotter-1.0.2 lib/misc/hash.rb
brandspotter-1.0.1 lib/misc/hash.rb
brandspotter-1.0.0 lib/misc/hash.rb
makeprintable-1.0.2 lib/misc/hash.rb
makeprintable-1.0.1 lib/misc/hash.rb
makeprintable-1.0.0 lib/misc/hash.rb