Class: Sinatra::REST::CustomController

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/rest.rb

Overview

used as context to evaluate the controller’s module

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix) ⇒ CustomController

Returns a new instance of CustomController.



184
185
186
187
# File 'lib/sinatra/rest.rb', line 184

def initialize(prefix)
  @prefix = prefix
  @module = Module.new
end

Instance Attribute Details

#moduleObject (readonly)

Returns the value of attribute module.



182
183
184
# File 'lib/sinatra/rest.rb', line 182

def module
  @module
end

Instance Method Details

#after(options = {}, &block) ⇒ Object



190
# File 'lib/sinatra/rest.rb', line 190

def after(options={}, &block)   prefix :after,   █ end

#before(options = {}, &block) ⇒ Object



189
# File 'lib/sinatra/rest.rb', line 189

def before(options={}, &block)  prefix :before,  █ end

#create(options = {}, &block) ⇒ Object



193
# File 'lib/sinatra/rest.rb', line 193

def create(options={}, &block)  prefix :create,  █ end

#destroy(options = {}, &block) ⇒ Object



197
# File 'lib/sinatra/rest.rb', line 197

def destroy(options={}, &block) prefix :destroy, █ end

#edit(options = {}, &block) ⇒ Object



195
# File 'lib/sinatra/rest.rb', line 195

def edit(options={}, &block)    prefix :edit,    █ end

#index(options = {}, &block) ⇒ Object



191
# File 'lib/sinatra/rest.rb', line 191

def index(options={}, &block)   prefix :index,   █ end

#new(options = {}, &block) ⇒ Object



192
# File 'lib/sinatra/rest.rb', line 192

def new(options={}, &block)     prefix :new,     █ end

#show(options = {}, &block) ⇒ Object



194
# File 'lib/sinatra/rest.rb', line 194

def show(options={}, &block)    prefix :show,    █ end

#update(options = {}, &block) ⇒ Object



196
# File 'lib/sinatra/rest.rb', line 196

def update(options={}, &block)  prefix :update,  █ end