Permalink
Browse files

We can just merge the hashes.

  • Loading branch information...
1 parent 3e8745f commit 0f955c6e79ecb6350220326a5fa389af216cdca0 @gabebw gabebw committed Jan 13, 2012
Showing with 5 additions and 12 deletions.
  1. +1 −4 lib/fake_braintree/customer.rb
  2. +4 −8 lib/fake_braintree/subscription.rb
View
5 lib/fake_braintree/customer.rb
@@ -57,10 +57,7 @@ def update_customer!(updates_hash)
end
def customer_hash
- hash = @customer_hash.dup
- hash["credit_cards"] = generate_credit_cards_from(hash["credit_card"])
-
- hash
+ @customer_hash.merge("credit_cards" => generate_credit_cards_from(@customer_hash["credit_card"]))
end
def customer_from_registry
View
12 lib/fake_braintree/subscription.rb
@@ -26,14 +26,10 @@ def update
private
def subscription_hash
- generated_subscription_hash = @subscription_hash.dup
-
- generated_subscription_hash["transactions"] = []
- generated_subscription_hash["add_ons"] = added_add_ons
- generated_subscription_hash["discounts"] = added_discounts
- generated_subscription_hash["next_billing_date"] = braintree_formatted_date(1.month.from_now)
-
- generated_subscription_hash
+ @subscription_hash.merge({"transactions" => [],
+ "add_ons" => added_add_ons,
+ "discounts" => added_discounts,
+ "next_billing_date" => braintree_formatted_date(1.month.from_now)})
end
def update_subscription!(updates)

0 comments on commit 0f955c6

Please sign in to comment.