module Cryptocompare::QueryParamHelper

Constants

QUERY_PARAM_MAPPING

Public Class Methods

set_query_params(path, opts) click to toggle source

Appends query parameters to path

# File lib/cryptocompare/helpers/query_param_helper.rb, line 9
def self.set_query_params(path, opts)
  path + "?#{to_query(opts)}"
end
to_query(opts) click to toggle source

Helper method to parse parameters and build query parameters

# File lib/cryptocompare/helpers/query_param_helper.rb, line 14
def self.to_query(opts)
  opts.collect do |key, value|
    "#{QUERY_PARAM_MAPPING[key]}=#{value}"
  end.sort * '&'
end