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.



127
128
129
130
# File 'lib/sinatra/rest.rb', line 127

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

Instance Attribute Details

#moduleObject (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