diff options
Diffstat (limited to 'bocelli/module/base.rb')
-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 |