#!/usr/bin/env ruby
# -*- encoding: UTF-8 -*-
class Base
attr_reader :blocks
class << self
def get(path, &block)
@blocks ||= []
@blocks << block
end
def reset!
@blocks = []
end
def run
@blocks.each do |bk|
bk.call
end
end
end
def self.inherited(subclass)
subclass.reset!
end
reset!
end
class Application < Base
get '/' do
puts "hi"
end
end
if __FILE__ == $0
Application.run
end