Skip to content

Instantly share code, notes, and snippets.

@copiousfreetime
Last active August 29, 2015 14:10
Show Gist options
  • Save copiousfreetime/74eea8d50a666c4b8122 to your computer and use it in GitHub Desktop.
Save copiousfreetime/74eea8d50a666c4b8122 to your computer and use it in GitHub Desktop.
mult_route roda app
class A < ::Roda
def do_a_thing
# ...
end
# route('a') do |r| -- doesn't work
::App.route('a') do |r|
r.get 'thing' do
do_a_thing # Method not Found
end
end
end
class App < ::Roda
plugin :multi_route
require './a'
require './b'
route do |r|
r.on 'a' do
r.multi_route('a')
end
r.on 'b' do
r.multi_route('b')
end
end
end
end
class B < ::Roda
def do_b_stuff
# ...
end
# route('b') do |r| -- doesn't work
::App.route('b') do |r|
r.get 'stuff' do
do_b_stuff # Method not found
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment