I have the following function in payment.rb
def self.create_customer_with_card arg
customer_list = Curl.get("#{BaseURL}/customer") do |curl|
curl.headers["Authorization"] = authorization_header
curl.headers['Content-Type'] = 'application/json'
end
customer = Curl.get("#{BaseURL}/customer/660391") do |curl|
curl.headers["Authorization"] = authorization_header
curl.headers['Content-Type'] = 'application/json'
end
byebug
end
I placed the byebug at the end of function. when no matter either I check customer_list
or customer
it gives me result of customer. while if I try them individually results are okay. But keeping both in same function assigns the output of second function to both variables. I'm using gem 'curb', '~> 0.9.4'
for curl. any idea?