Skip to content

Instantly share code, notes, and snippets.

@jackhq
Created March 25, 2010 04:08
Show Gist options
  • Save jackhq/343163 to your computer and use it in GitHub Desktop.
Save jackhq/343163 to your computer and use it in GitHub Desktop.
class Base
name: "Base"
children: []
find: (name) ->
for child in this.children
if child.name == name
result: child
break
result
add: (child) ->
this.children[this.children.length]: child
class Application extends Base
version: "0.0.1"
run: (options) ->
this.find(options.controller)[options.action ?= 'index'](options.params ?= {} )
class Controller extends Base
name: "Controller"
class View
name: "View"
render: ->
print "Not Implemented"
window.View: View
window.Controller: Controller
window.Application: new Application()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment