File: example_app.rb

package info (click to toggle)
ruby-yard-sinatra 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 80 kB
  • ctags: 25
  • sloc: ruby: 154; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 582 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "sinatra/base"
require "user"

class ExampleApp < Sinatra::Base

  # Settings for a given user
  #
  # @param [User] some user
  # @return [Hash] settings for that user
  def settings(some_user)
    raise NotImplementedMethod
  end
  
  # Displays a settings page for the current user
  #
  # @see ExampleApp#settings
  get "/settings" do
    haml :settings, {}, :settings => settings(current_user)
  end

  # Error 404 Page Not Found
  not_found do
    haml :'404'
  end

  put("/settings") { }
  delete("/settings") { }
  post("/settings") { }
  head("/settings") { }

end