lib/fake_braintree/address.rb in fake_braintree-0.4.3 vs lib/fake_braintree/address.rb in fake_braintree-0.5.0
- old
+ new
@@ -5,35 +5,35 @@
def initialize(address_hash_from_params, options)
set_up_address(address_hash_from_params, options)
end
def create
- @hash['id'] = generate_id
- FakeBraintree.registry.addresses[id] = @hash
- customer['addresses'] << @hash
+ @address['id'] = generate_id
+ FakeBraintree.registry.addresses[id] = @address
+ customer['addresses'] << @address
response_for_updated_address
end
def customer
- FakeBraintree.registry.customers[@hash['customer_id']]
+ FakeBraintree.registry.customers[@address['customer_id']]
end
def response_for_updated_address
- gzipped_response(200, @hash.to_xml(root: 'address'))
+ gzipped_response(200, @address.to_xml(root: 'address'))
end
def set_up_address(address_hash_from_params, options)
- @hash = {
+ @address = {
"merchant_id" => options[:merchant_id],
"customer_id" => options[:customer_id],
}.merge(address_hash_from_params)
end
def generate_id
- "#{@hash['customer_id']}_#{customer['addresses'].size}"
+ "#{@address['customer_id']}_#{customer['addresses'].size}"
end
def id
- @hash['id']
+ @address['id']
end
end
end