Sha256: 2e59fead3c4d6f21a9bc1a66800f9f1472f97294007517cfffbde2a5aedbd6da

Contents?: true

Size: 261 Bytes

Versions: 2

Compression:

Stored size: 261 Bytes

Contents

require 'rack/utils'
require 'uri'

module MobilePagination
  module Utils

    def query_to_hash(qs)
      Rack::Utils.parse_nested_query(qs) || {}
    end

    def hash_to_query(hash)
      URI.encode(hash.map{|k,v| "#{k}=#{v}"}.join("&"))
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mobile_pagination-0.0.9 lib/mobile_pagination/utils.rb
mobile_pagination-0.0.8 lib/mobile_pagination/utils.rb