Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better method names.

commit 3daf2aa2a965501189f2379e2afcbf4c93a085f3 1 parent 0f955c6
@gabebw gabebw authored
View
4 lib/fake_braintree/credit_card.rb
@@ -9,7 +9,7 @@ def initialize(credit_card_hash_from_params, options)
def update
if credit_card_exists_in_registry?
- update_credit_card!
+ update_existing_credit_card
response_for_updated_card
else
response_for_card_not_found
@@ -18,7 +18,7 @@ def update
private
- def update_credit_card!
+ def update_existing_credit_card
@hash = credit_card_from_registry.merge!(@hash)
end
View
4 lib/fake_braintree/customer.rb
@@ -25,7 +25,7 @@ def create
def update
if customer_exists_in_registry?
updates = customer_hash
- updated_customer = update_customer!(updates)
+ updated_customer = update_existing_customer(updates)
response_for_updated_customer(updated_customer)
else
response_for_customer_not_found
@@ -52,7 +52,7 @@ def add_credit_card_to_registry(new_credit_card_hash)
FakeBraintree.registry.credit_cards[token] = new_credit_card_hash
end
- def update_customer!(updates_hash)
+ def update_existing_customer(updates_hash)
customer_from_registry.merge!(updates_hash)
end
View
4 lib/fake_braintree/subscription.rb
@@ -16,7 +16,7 @@ def create
def update
if subscription_exists_in_registry?
- updated_subscription = update_subscription!(subscription_hash)
+ updated_subscription = update_existing_subscription(subscription_hash)
response_for_created_subscription(updated_subscription)
else
response_for_subscription_not_found
@@ -32,7 +32,7 @@ def subscription_hash
"next_billing_date" => braintree_formatted_date(1.month.from_now)})
end
- def update_subscription!(updates)
+ def update_existing_subscription(updates)
updated_subscription = subscription_from_registry.merge(updates)
FakeBraintree.registry.subscriptions[subscription_id] = updated_subscription
end
Please sign in to comment.
Something went wrong with that request. Please try again.