Sha256: ac299335d1f3969e077c913d21467016772a7cbd11cfdb4c0d443b763c1977c8

Contents?: true

Size: 704 Bytes

Versions: 14

Compression:

Stored size: 704 Bytes

Contents

require 'sinatra/base'
require 'slim'

module ServiceContract
  module Avro
    class Documentation < Sinatra::Base
      get '/:version/:protocol' do
        version = service.find(params[:version])
        protocol = version.protocol(params[:protocol])
        slim :protocol, locals: { version: version, protocol: protocol }
      end

      get '/:version' do
        version = service.find(params[:version])

        if version
          slim :version, locals: { version: version }
        else
          status 404
        end
      end

      get '/' do
        slim :homepage
      end

      helpers do
        def service
          raise :not_implemented
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
service_contract-0.5.1 lib/service_contract/avro/documentation.rb
service_contract-0.5.0 lib/service_contract/avro/documentation.rb
service_contract-0.4.1 lib/service_contract/avro/documentation.rb
service_contract-0.4.0 lib/service_contract/avro/documentation.rb
service_contract-0.3.0 lib/service_contract/avro/documentation.rb
service_contract-0.2.1 lib/service_contract/avro/documentation.rb
service_contract-0.2.0 lib/service_contract/avro/documentation.rb
service_contract-0.1.1 lib/service_contract/avro/documentation.rb
service_contract-0.1.0 lib/service_contract/avro/documentation.rb
service_contract-0.0.10 lib/service_contract/avro/documentation.rb
service_contract-0.0.8 lib/service_contract/avro/documentation.rb
service_contract-0.0.7 lib/service_contract/avro/documentation.rb
service_contract-0.0.6 lib/service_contract/avro/documentation.rb
service_contract-0.0.5 lib/service_contract/avro/documentation.rb