Class: Apitest::ApitestController

Inherits:
ApplicationController show all
Defined in:
app/controllers/apitest/apitest_controller.rb

Instance Method Summary collapse

Constructor Details

#initializeApitestController

Returns a new instance of ApitestController.



6
7
8
9
10
11
12
# File 'app/controllers/apitest/apitest_controller.rb', line 6

def initialize
  super
  @apidocs    = {}
  @headers    = Apitest::set_headers
  @token_set =  Apitest::token_setting[:set]
  @token_get =  Apitest::token_setting[:get]
end

Instance Method Details

#indexObject



13
14
15
16
17
18
# File 'app/controllers/apitest/apitest_controller.rb', line 13

def index
  respond_to do |format|
    format.json { render json: @apidocs}
    format.html 
  end
end

#showObject



20
21
22
23
24
25
# File 'app/controllers/apitest/apitest_controller.rb', line 20

def show
  respond_to do |format|
    format.html 
    format.json { render json: @apidocs[params[:id]]}
  end
end