Sha256: f8a8f525da91272882ee5079c6b3bc4f4b0df977ec3a9f03a24cd10dc239e92a

Contents?: true

Size: 740 Bytes

Versions: 4

Compression:

Stored size: 740 Bytes

Contents

require 'pact_broker/api/resources/base_resource'
require 'pact_broker/api/decorators/relationships_csv_decorator'

module PactBroker
  module Api
    module Resources
      class Group < BaseResource
        def content_types_provided
          [["text/csv", :to_csv]]
        end

        def allowed_methods
          ["GET", "OPTIONS"]
        end

        def resource_exists?
          pacticipant
        end

        def to_csv
          PactBroker::Api::Decorators::RelationshipsCsvDecorator.new(group).to_csv
        end

        def policy_name
          :'groups::group'
        end

        private

        def group
          @group ||= group_service.find_group_containing(pacticipant)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pact_broker-2.69.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.68.1 lib/pact_broker/api/resources/group.rb
pact_broker-2.68.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.67.0 lib/pact_broker/api/resources/group.rb