Class: Sinatra::REST::CustomController
- Inherits:
-
Object
- Object
- Sinatra::REST::CustomController
- Defined in:
- lib/sinatra/rest.rb
Overview
used as context to evaluate the controller’s module
Instance Attribute Summary collapse
-
#module ⇒ Object
readonly
Returns the value of attribute module.
Instance Method Summary collapse
- #after(&block) ⇒ Object
- #before(&block) ⇒ Object
- #create(&block) ⇒ Object
- #destroy(&block) ⇒ Object
- #edit(&block) ⇒ Object
- #index(&block) ⇒ Object
-
#initialize(prefix) ⇒ CustomController
constructor
A new instance of CustomController.
- #new(&block) ⇒ Object
- #show(&block) ⇒ Object
- #update(&block) ⇒ Object
Constructor Details
#initialize(prefix) ⇒ CustomController
Returns a new instance of CustomController.
127 128 129 130 |
# File 'lib/sinatra/rest.rb', line 127 def initialize(prefix) @prefix = prefix @module = Module.new end |
Instance Attribute Details
#module ⇒ Object (readonly)
Returns the value of attribute module.
125 126 127 |
# File 'lib/sinatra/rest.rb', line 125 def module @module end |
Instance Method Details
#after(&block) ⇒ Object
133 |
# File 'lib/sinatra/rest.rb', line 133 def after(&block) prefix :after, █ end |
#before(&block) ⇒ Object
132 |
# File 'lib/sinatra/rest.rb', line 132 def before(&block) prefix :before, █ end |
#create(&block) ⇒ Object
136 |
# File 'lib/sinatra/rest.rb', line 136 def create(&block) prefix :create, █ end |
#destroy(&block) ⇒ Object
140 |
# File 'lib/sinatra/rest.rb', line 140 def destroy(&block) prefix :destroy, █ end |
#edit(&block) ⇒ Object
138 |
# File 'lib/sinatra/rest.rb', line 138 def edit(&block) prefix :edit, █ end |
#index(&block) ⇒ Object
134 |
# File 'lib/sinatra/rest.rb', line 134 def index(&block) prefix :index, █ end |
#new(&block) ⇒ Object
135 |
# File 'lib/sinatra/rest.rb', line 135 def new(&block) prefix :new, █ end |
#show(&block) ⇒ Object
137 |
# File 'lib/sinatra/rest.rb', line 137 def show(&block) prefix :show, █ end |
#update(&block) ⇒ Object
139 |
# File 'lib/sinatra/rest.rb', line 139 def update(&block) prefix :update, █ end |