Sha256: ebdbcab8cda450f5cd473d1573a2ef68fcca8e65d41dd1a5430125c7667b2b22

Contents?: true

Size: 741 Bytes

Versions: 7

Compression:

Stored size: 741 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

7 entries across 7 versions & 1 rubygems

Version Path
pact_broker-2.66.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.65.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.64.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.63.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.62.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.61.0 lib/pact_broker/api/resources/group.rb
pact_broker-2.60.1 lib/pact_broker/api/resources/group.rb