Guest User

Untitled

a guest
Jun 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. ### Line 15
  2. def total
  3. pennies + nickels + dimes + quarters + ones + fives + tens + twenties + fifties + hundreds
  4. end
  5.  
  6. ### Line 19
  7. def discrepancy?
  8. total != amount.abs
  9. end
  10.  
  11. ### Line 32
  12. protected
  13. def must_not_have_discrepancy
  14. errors.add("amount", "does not match totals given.") if discrepancy?
  15. end
Add Comment
Please, Sign In to add comment