summaryrefslogtreecommitdiff
path: root/bocelli/module
diff options
context:
space:
mode:
Diffstat (limited to 'bocelli/module')
-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