summaryrefslogtreecommitdiff
path: root/bocelli/module/base.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-08-17 23:31:45 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-08-17 23:31:45 -0700
commite633d656e00fdac51f077eff827518848235e916 (patch)
tree0b40a60f95b219545d40fe709e11583ab9e3df6b /bocelli/module/base.rb
downloadbocelli-e633d656e00fdac51f077eff827518848235e916.tar.gz
bocelli-e633d656e00fdac51f077eff827518848235e916.tar.xz
Initial commit.
Diffstat (limited to 'bocelli/module/base.rb')
-rw-r--r--bocelli/module/base.rb25
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