From e633d656e00fdac51f077eff827518848235e916 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 17 Aug 2014 23:31:45 -0700 Subject: Initial commit. --- bocelli/module/base.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bocelli/module/base.rb (limited to 'bocelli/module') 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 -- cgit v1.2.3-70-g09d2