Skip to content

Instantly share code, notes, and snippets.

@copiousfreetime
Last active August 29, 2015 14:10
Show Gist options
  • Save copiousfreetime/5792ee728961d60b56e5 to your computer and use it in GitHub Desktop.
Save copiousfreetime/5792ee728961d60b56e5 to your computer and use it in GitHub Desktop.
Roda App with sub applications
class A < ::Roda
def do_a_thing
# ...
end
route do |r|
r.get 'thing' do
do_a_thing
end
end
end
class App < ::Roda
require './a'
require './b'
route do |r|
r.on 'a' do
r.run ::A
end
r.on 'b' do
r.run ::B
end
end
end
class B < ::Roda
def do_b_stuff
# ...
end
route do |r|
r.get 'stuff' do
do_b_stuff
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment