Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ParthBarot-BoTreeConsulting/707522d7cc9dc038ff4c to your computer and use it in GitHub Desktop.
Save ParthBarot-BoTreeConsulting/707522d7cc9dc038ff4c to your computer and use it in GitHub Desktop.
Nested class structure using coffee script
class UsersProfileController
constructor: ->
return
assets: (params) ->
@a = new AssetsHandler(params)
@a.one()
@a.two()
return
class AssetsHandler
constructor: (@params) ->
one: ->
alert 'one -' + @params
two: ->
alert 'two -' + @params
u = new UsersProfileController
u.assets([1,2,3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment