module Alman::ParamsBuilder

Public Class Methods

build(params, api_key=nil, auth_key=nil) click to toggle source
# File lib/alman/apibits/params_builder.rb, line 18
def self.build(params, api_key=nil, auth_key=nil)
  default_params.merge(clean(params))
end
clean(params) click to toggle source
# File lib/alman/apibits/params_builder.rb, line 4
def self.clean(params)
  Util.symbolize_keys(params || {})
end
default_params() click to toggle source
# File lib/alman/apibits/params_builder.rb, line 22
def self.default_params
  params = {}
end
merge(*args) click to toggle source

Clean the params, and the hash to_merge, and then merge them. This ensures that we dont get something like { “id” => 123, :id => 321 }.

# File lib/alman/apibits/params_builder.rb, line 10
def self.merge(*args)
  ret = {}
  args.each do |arg|
    ret = ret.merge(clean(arg))
  end
  ret
end