Sha256: 6f1d09a75e0d0d5ca0930474334568099e528d3556b00c3f35d9a00ff29f3eba

Contents?: true

Size: 205 Bytes

Versions: 6

Compression:

Stored size: 205 Bytes

Contents

module Murlsh

  module_function

  # Query string builder. Takes hash of query string variables.
  def build_query(h)
    h.empty? ? '' : '?' + h.map { |k,v| URI.escape "#{k}=#{v}" }.join('&')
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
murlsh-1.4.1 lib/murlsh/build_query.rb
murlsh-1.4.0 lib/murlsh/build_query.rb
murlsh-1.3.1 lib/murlsh/build_query.rb
murlsh-1.3.0 lib/murlsh/build_query.rb
murlsh-1.2.1 lib/murlsh/build_query.rb
murlsh-1.2.0 lib/murlsh/build_query.rb