Class: PactBroker::Pacts::Diff::DiffDecorator

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

Overview

The next pact version after the previous distinct version. Eg. v1 (previous distinct) -> pactContentA

v2 (next pact)         -> pactContentB
v3                     -> pactContentB
v4 (current)           -> pactContentB

If we are at v4, then the previous distinct pact version is v1, and the next pact after that is v2. The timestamps on v2 are the ones we want - that’s when the latest distinct version content was first created.

Instance Method Summary collapse

Constructor Details

#initialize(pact, previous_distinct_pact, next_pact, base_url) ⇒ DiffDecorator

Returns a new instance of DiffDecorator.



49
50
51
52
53
54
# File 'lib/pact_broker/pacts/diff.rb', line 49

def initialize(pact, previous_distinct_pact, next_pact, base_url)
  @pact = pact
  @previous_distinct_pact = previous_distinct_pact
  @next_pact = next_pact
  @base_url = base_url
end

Instance Method Details

#to_textObject



56
57
58
# File 'lib/pact_broker/pacts/diff.rb', line 56

def to_text
  header + "\n\n" + diff + "\n\n" + links
end