Skip to content

Instantly share code, notes, and snippets.

@airhorns
Created September 19, 2011 19:54
Show Gist options
  • Select an option

  • Save airhorns/1227418 to your computer and use it in GitHub Desktop.

Select an option

Save airhorns/1227418 to your computer and use it in GitHub Desktop.
class SomeController extends Batman.Controller
@accessor
get: (key) ->
return @[key] if @[key]?
return @get('someModel').get(key)
set: (key, val) ->
return @[key] = val if @[key]?
return @get('someModel').set(key, val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment