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

#pact_version_shaObject

Returns the value of attribute pact_version_sha

Returns:

  • (Object)

    the current value of pact_version_sha



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

def pact_version_sha
  @pact_version_sha
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(hash) ⇒ Object



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

def self.from_hash(hash)
  new(**hash)
end

Instance Method Details

#merge?Boolean

Returns:

  • (Boolean)


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

def merge?
  on_conflict == "merge"
end

#pact?Boolean

Returns:

  • (Boolean)


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

def pact?
  specification == "pact"
end

#pacticipant_namesObject



17
18
19
# File 'lib/pact_broker/contracts/contract_to_publish.rb', line 17

def pacticipant_names
  [consumer_name, provider_name]
end