Class: EasyApiDoc::DocumentationController

Inherits:
ApplicationController show all
Defined in:
app/controllers/easy_api_doc/documentation_controller.rb

Instance Method Summary collapse

Instance Method Details

#api_actionObject



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

#namespaceObject



5
6
7
# File 'app/controllers/easy_api_doc/documentation_controller.rb', line 5

def namespace
  @resources = @namespace.resources
end

#resourceObject



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