Class: PactBroker::Pacts::Diff
- Inherits:
-
Object
- Object
- PactBroker::Pacts::Diff
- Includes:
- Repositories
- Defined in:
- lib/pact_broker/pacts/diff.rb
Defined Under Namespace
Classes: DiffDecorator
Instance Method Summary collapse
Methods included from Repositories
#branch_version_repository, #label_repository, #matrix_repository, #pact_repository, #pacticipant_repository, #tag_repository, #verification_repository, #version_repository, #webhook_repository
Instance Method Details
#process(params, comparison_pact_params = nil, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pact_broker/pacts/diff.rb', line 15 def process(params, comparison_pact_params = nil, = {}) pact = find_pact(params) comparison_pact = comparison_pact_params ? find_pact(comparison_pact_params) : pact_repository.find_previous_distinct_pact(pact) if comparison_pact next_pact = pact_repository.find_next_pact(comparison_pact) || pact DiffDecorator.new(pact, comparison_pact, next_pact, params[:base_url], { raw: [:raw] }).to_text else pact end end |