module Paid::ParamsBuilder
Public Class Methods
build(params, api_key=nil, auth_key=nil)
click to toggle source
# File lib/paid/params_builder.rb, line 16 def self.build(params, api_key=nil, auth_key=nil) clean(params) end
clean(params)
click to toggle source
# File lib/paid/params_builder.rb, line 4 def self.clean(params) Util.symbolize_keys(params || {}) end
merge(params, to_merge)
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/paid/params_builder.rb, line 10 def self.merge(params, to_merge) params = clean(params) to_merge = clean(to_merge) params.merge(to_merge) end