Class: PactBroker::Pacts::HeadPact

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pact_broker/pacts/head_pact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pact, consumer_version_number, tag) ⇒ HeadPact

Returns a new instance of HeadPact.



11
12
13
14
15
# File 'lib/pact_broker/pacts/head_pact.rb', line 11

def initialize(pact, consumer_version_number, tag)
  super(pact)
  @consumer_version_number = consumer_version_number
  @tag = tag
end

Instance Attribute Details

#consumer_version_numberObject (readonly)

Returns the value of attribute consumer_version_number.



9
10
11
# File 'lib/pact_broker/pacts/head_pact.rb', line 9

def consumer_version_number
  @consumer_version_number
end

#tagObject (readonly)

Returns the value of attribute tag.



9
10
11
# File 'lib/pact_broker/pacts/head_pact.rb', line 9

def tag
  @tag
end

Instance Method Details

#overall_latest?Boolean

The underlying pact publication may well be the overall latest as well, but this row does not know that, as there will be a row with a nil tag if it is the overall latest as well as a row with the tag set, as the data is denormalised in the LatestTaggedPactPublications table.

Returns:

  • (Boolean)


21
22
23
# File 'lib/pact_broker/pacts/head_pact.rb', line 21

def overall_latest?
  tag.nil?
end

#pactObject



25
26
27
# File 'lib/pact_broker/pacts/head_pact.rb', line 25

def pact
  __getobj__()
end