Class: Compass::ApplicationController
- Inherits:
-
ActionController::API
- Object
- ActionController::API
- Compass::ApplicationController
show all
- Defined in:
- app/controllers/compass/application_controller.rb
Overview
Instance Method Summary
collapse
Instance Method Details
#authenticate ⇒ Object
9
10
11
|
# File 'app/controllers/compass/application_controller.rb', line 9
def authenticate
head(:forbidden) unless instance_exec(&Compass.config.authenticate)
end
|
#current_context ⇒ Object
17
18
19
|
# File 'app/controllers/compass/application_controller.rb', line 17
def current_context
instance_exec(&Compass.config.context)
end
|
#current_context_id ⇒ Object
21
22
23
|
# File 'app/controllers/compass/application_controller.rb', line 21
def current_context_id
instance_exec(&Compass.config.context_id)
end
|
#validate_context ⇒ Object
13
14
15
|
# File 'app/controllers/compass/application_controller.rb', line 13
def validate_context
head(:bad_request) unless current_context_id.to_s.eql?(params[:context_id])
end
|