Sha256: 233fa9bbf94f43225a0350dfac2d34d0ea111a55d95071739746d0459f8303bb

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

require 'pact_broker/api/resources/base_resource'

module PactBroker::Api

  module Resources

    class Pacticipants < BaseResource

      def content_types_provided
        [["application/hal+json", :to_json]]
      end

      def allowed_methods
        ["GET"]
      end

      def to_json
        generate_json(pacticipant_service.find_all_pacticipants)
      end

      def generate_json pacticipants
        PactBroker::Api::Decorators::PacticipantCollectionRepresenter.new(pacticipants).to_json(base_url: request_base_url)
      end

    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact_broker-0.0.9 lib/pact_broker/api/resources/pacticipants.rb