Skip to content

Instantly share code, notes, and snippets.

@hassox
Created November 9, 2009 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hassox/229792 to your computer and use it in GitHub Desktop.
Save hassox/229792 to your computer and use it in GitHub Desktop.
##### Stack Inheritance example
class OurBaseStack < Pancake::Stacks::Short
router do |r|
r.mount(UserStack, "/users")
r.mount(AdminStack, "/admin")
r.mount(AssetStack, "/assets")
r.add("/heartbeat"){ |env| Rack::Response.new("alive!").finish }
end
stack(:uploader).use(Rack::Upload)
get "(/)" do
render :welcome
end
end
class ClientApplication < OurBaseStack
get "/specific/functionality" do
# stuff
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment