Skip to content

Instantly share code, notes, and snippets.

@soasme
Last active December 16, 2015 09:09
Show Gist options
  • Save soasme/5411338 to your computer and use it in GitHub Desktop.
Save soasme/5411338 to your computer and use it in GitHub Desktop.
A DSL practise of restful route
# -*- coding: utf-8 -*-
#
#
def get(url, &block)
@url ||= Hash.new do |hash, key|
hash[key] = block
end
@url[url].call()
end
get '/hello' do
print 'world'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment