/documentation/coffee/fat_arrow.coffee

http://github.com/jashkenas/coffee-script · CoffeeScript · 6 lines · 5 code · 1 blank · 0 comment · 0 complexity · 8459fedacc45aa48316ad9a92adf897f MD5 · raw file

  1. Account = (customer, cart) ->
  2. @customer = customer
  3. @cart = cart
  4. $('.shopping_cart').on 'click', (event) =>
  5. @customer.purchase @cart