Sha256: 6babceaf162490913d43c25cca8dbf2cda032b7c111d88d068e24df6995de581

Contents?: true

Size: 210 Bytes

Versions: 5

Compression:

Stored size: 210 Bytes

Contents

class Hash
  #
  # Converts a hash into an URL query string
  #
  def to_query(namespace=nil)
    map do |key, value|
      value.to_query(namespace ? "#{namespace}[#{key}]" : key)
    end.sort * '&'
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
under-os-http-1.4.0 lib/core/hash.rb
under-os-1.3.0 lib/under_os/core/hash.rb
under-os-1.2.1 lib/under_os/core/hash.rb
under-os-1.2.0 lib/under_os/core/hash.rb
under-os-1.1.0 lib/under_os/core/hash.rb