Class: PactBroker::Pacts::Diff::DiffDecorator
- Inherits:
-
Object
- Object
- PactBroker::Pacts::Diff::DiffDecorator
- 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 Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#next_pact ⇒ Object
readonly
Returns the value of attribute next_pact.
-
#pact ⇒ Object
readonly
Returns the value of attribute pact.
-
#previous_distinct_pact ⇒ Object
readonly
Returns the value of attribute previous_distinct_pact.
Instance Method Summary collapse
-
#initialize(pact, previous_distinct_pact, next_pact, base_url) ⇒ DiffDecorator
constructor
A new instance of DiffDecorator.
- #to_text ⇒ Object
Constructor Details
#initialize(pact, previous_distinct_pact, next_pact, base_url) ⇒ DiffDecorator
Returns a new instance of DiffDecorator.
52 53 54 55 56 57 |
# File 'lib/pact_broker/pacts/diff.rb', line 52 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 Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
50 51 52 |
# File 'lib/pact_broker/pacts/diff.rb', line 50 def base_url @base_url end |
#next_pact ⇒ Object (readonly)
Returns the value of attribute next_pact.
50 51 52 |
# File 'lib/pact_broker/pacts/diff.rb', line 50 def next_pact @next_pact end |
#pact ⇒ Object (readonly)
Returns the value of attribute pact.
50 51 52 |
# File 'lib/pact_broker/pacts/diff.rb', line 50 def pact @pact end |
#previous_distinct_pact ⇒ Object (readonly)
Returns the value of attribute previous_distinct_pact.
50 51 52 |
# File 'lib/pact_broker/pacts/diff.rb', line 50 def previous_distinct_pact @previous_distinct_pact end |
Instance Method Details
#to_text ⇒ Object
59 60 61 |
# File 'lib/pact_broker/pacts/diff.rb', line 59 def to_text header + "\n\n" + diff + "\n\n" + links end |