Sha256: b2edf139ae5fae7c4639fc928a65f2150831a179dbcf38156c0277affdd5db65

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

module Taksi
  class InterfacesController < ::Taksi::ApplicationController
    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

    protected

    def parameters
      params
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
taksi-rails-0.2.1 app/controllers/taksi/interfaces_controller.rb