Sha256: 5fce791fb6df0a15dcd8a2a4e6e2c87182249aa5a8c0cffbfb1f3a0b8630e740
Contents?: true
Size: 540 Bytes
Versions: 83
Compression:
Stored size: 540 Bytes
Contents
class TenonDispatcher constructor: -> @routes = { } initialize: -> body = $('body') controller = body.data('controller') action = body.data('action') @dispatch('tenon', 'initialize') @dispatch(controller, 'initialize') @dispatch(controller, action) route: (amalgam, fn) -> [controller, action] = amalgam.split('#') @routes[controller] ?= { } @routes[controller][action] = fn dispatch: (controller, action) -> @routes[controller]?[action]?() Tenon.dispatcher = new TenonDispatcher
Version data entries
83 entries across 83 versions & 1 rubygems