Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CoolModelWithDefaults extends Batman.Model
- @wrapAccessor 'type', (core) ->
- get: -> core.get.apply(@, arguments) || 'default_type'
- set: core.set
- unset: core.unset
- # Now (new CoolModelWithDefaults).get('type') will return 'default_type' until 'type' is set. :)
Add Comment
Please, Sign In to add comment