Class: PactBroker::Api::Resources::ProviderPacts

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/pact_broker/api/resources/provider_pacts.rb

Instance Method Summary collapse

Instance Method Details

#allowed_methodsObject



14
15
16
# File 'lib/pact_broker/api/resources/provider_pacts.rb', line 14

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

#content_types_providedObject



10
11
12
# File 'lib/pact_broker/api/resources/provider_pacts.rb', line 10

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

#policy_nameObject



22
23
24
# File 'lib/pact_broker/api/resources/provider_pacts.rb', line 22

def policy_name
  :'pacts:provider_pacts'
end

#policy_recordObject



26
27
28
# File 'lib/pact_broker/api/resources/provider_pacts.rb', line 26

def policy_record
  provider
end

#resource_exists?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/pact_broker/api/resources/provider_pacts.rb', line 18

def resource_exists?
  !!provider
end

#to_jsonObject



30
31
32
# File 'lib/pact_broker/api/resources/provider_pacts.rb', line 30

def to_json
  PactBroker::Api::Decorators::ProviderPactsDecorator.new(pacts).to_json(to_json_options)
end