Class: PactBroker::Contracts::ContractToPublish

Inherits:
Struct
  • Object
show all
Defined in:
lib/pact_broker/contracts/contract_to_publish.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#consumer_nameObject

Returns the value of attribute consumer_name

Returns:

  • (Object)

    the current value of consumer_name



3
4
5
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 3

def consumer_name
  @consumer_name
end

#content_typeObject

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



3
4
5
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 3

def content_type
  @content_type
end

#decoded_contentObject

Returns the value of attribute decoded_content

Returns:

  • (Object)

    the current value of decoded_content



3
4
5
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 3

def decoded_content
  @decoded_content
end

#on_conflictObject

Returns the value of attribute on_conflict

Returns:

  • (Object)

    the current value of on_conflict



3
4
5
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 3

def on_conflict
  @on_conflict
end

#provider_nameObject

Returns the value of attribute provider_name

Returns:

  • (Object)

    the current value of provider_name



3
4
5
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 3

def provider_name
  @provider_name
end

#specificationObject

Returns the value of attribute specification

Returns:

  • (Object)

    the current value of specification



3
4
5
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 3

def specification
  @specification
end

Class Method Details

.from_hash(consumer_name: nil, provider_name: nil, decoded_content: nil, content_type: nil, specification: nil, on_conflict: nil) ⇒ Object

rubocop: disable Metrics/ParameterLists



5
6
7
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 5

def self.from_hash(consumer_name: nil, provider_name: nil, decoded_content: nil, content_type: nil, specification: nil, on_conflict: nil)
  new(consumer_name, provider_name, decoded_content, content_type, specification, on_conflict)
end

Instance Method Details

#merge?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 14

def merge?
  on_conflict == "merge"
end

#pact?Boolean

rubocop: enable Metrics/ParameterLists

Returns:

  • (Boolean)


10
11
12
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 10

def pact?
  specification == "pact"
end