diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-08-17 23:31:45 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-08-17 23:31:45 -0700 |
commit | e633d656e00fdac51f077eff827518848235e916 (patch) | |
tree | 0b40a60f95b219545d40fe709e11583ab9e3df6b /bocelli/module | |
download | bocelli-e633d656e00fdac51f077eff827518848235e916.tar.gz bocelli-e633d656e00fdac51f077eff827518848235e916.tar.xz |
Initial commit.
Diffstat (limited to 'bocelli/module')
-rw-r--r-- | bocelli/module/base.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bocelli/module/base.rb b/bocelli/module/base.rb new file mode 100644 index 0000000..1306830 --- /dev/null +++ b/bocelli/module/base.rb @@ -0,0 +1,25 @@ +module Bocelli + module Module + module Base + attr_reader :routes + + def setup + @routes = {} + end + + def on(route, &block) + raise 'no block given' if block.nil? + + @routes[route] = block + end + + class << self + def extended(mod) + super + + mod.setup + end + end + end + end +end |