Class: Taksi::InterfacesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/taksi/interfaces_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/taksi/interfaces_controller.rb', line 5

def show
  return head(404) unless params[:id].match?(::Taksi::Registry::NAME_REGEX)

  interface = ::Taksi::Interface.find(params[:id].to_sym,
                                      request.env['X_TAKSI_VERSION']).new(params: parameters)

  render json: interface.skeleton.to_json
rescue Taksi::Registry::InterfaceNotFoundError
  head(404)
end