Class: EasyApiDoc::DocumentationController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- EasyApiDoc::DocumentationController
- Defined in:
- app/controllers/easy_api_doc/documentation_controller.rb
Instance Method Summary collapse
Instance Method Details
#api_action ⇒ Object
17 18 19 20 |
# File 'app/controllers/easy_api_doc/documentation_controller.rb', line 17 def api_action @resource = @namespace.resources.find {|r| r.name == params[:resource] } @action = @resource.actions.find {|a| a.name == params[:api_action] } end |
#namespace ⇒ Object
5 6 7 |
# File 'app/controllers/easy_api_doc/documentation_controller.rb', line 5 def namespace @resources = @namespace.resources end |
#resource ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/easy_api_doc/documentation_controller.rb', line 9 def resource @resource = @namespace.resources.find {|r| r.name == params[:resource] } if @resource.nil? raise "no resource #{params[:resource]}" end @actions = @resource.actions end |