Permalink
Browse files

Update hashes in SalesEngine to 1.9. See #313.

  • Loading branch information...
kytrinyx committed Nov 15, 2012
1 parent 95a6f04 commit 185fbd0c95fb0aace8cefac8a62438d669ff17d7
Showing with 6 additions and 6 deletions.
  1. +6 −6 source/projects/sales_engine.markdown
@@ -168,20 +168,20 @@ _NOTE_: All revenues should be reported as a `BigDecimal` object with two decima
Given a hash of inputs, you can create new invoices on the fly using this syntax:
```
-invoice = Invoice.create(:customer => customer, :merchant => merchant, :status => "shipped",
- :items => [item1, item2, item3])
+invoice = Invoice.create(customer: customer, merchant: merchant, status: "shipped",
+ items: [item1, item2, item3])
```
Assuming that `customer`, `merchant`, and `item1`/`item2`/`item3` are instances of their respective classes.
You should determine the quantity bought for each item by how many times the item is in the `:items` array.
-So, for `:items => [item1, item1, item2]`, the quantity bought will be 2 for `item1` and 1 for `item2`.
+So, for `items: [item1, item1, item2]`, the quantity bought will be 2 for `item1` and 1 for `item2`.
Then, on such an invoice you can call:
```ruby
-invoice.charge(:credit_card_number => "4444333322221111",
- :credit_card_expiration => "10/13", :result => "success")
+invoice.charge(credit_card_number: "4444333322221111",
+ credit_card_expiration: "10/13", result: "success")
```
The objects created through this process would then affect calculations, finds, etc.
@@ -258,4 +258,4 @@ We decided that the performance grading was not effective. Instead, we're going
Find the data files at https://github.com/JumpstartLab/sales_engine
-Measure your final product using the test harness at https://github.com/JumpstartLab/sales_engine_spec_harness
+Measure your final product using the test harness at https://github.com/JumpstartLab/sales_engine_spec_harness

0 comments on commit 185fbd0

Please sign in to comment.