Guest User

Untitled

a guest
Sep 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class CoolModelWithDefaults extends Batman.Model
  2. @wrapAccessor 'type', (core) ->
  3. get: -> core.get.apply(@, arguments) || 'default_type'
  4. set: core.set
  5. unset: core.unset
  6.  
  7. # Now (new CoolModelWithDefaults).get('type') will return 'default_type' until 'type' is set. :)
Add Comment
Please, Sign In to add comment