module Beslist::ParamsEncoder

Public Class Methods

decode(string) click to toggle source
# File lib/beslist/util/params_encoder.rb, line 14
def self.decode(string)
  string
end
encode(params) click to toggle source
# File lib/beslist/util/params_encoder.rb, line 3
def self.encode(params)
  params.map do |k, v|
    case v
    when Array, Hash
      "#{k}=#{URI.escape(JSON.dump(v))}"
    else
      "#{k}=#{v}"
    end
  end.join('&')
end