Module: Pact::MatchingRules

Defined in:
lib/pact/matching_rules.rb,
lib/pact/matching_rules/merge.rb,
lib/pact/matching_rules/extract.rb,
lib/pact/matching_rules/jsonpath.rb,
lib/pact/matching_rules/v3/merge.rb

Defined Under Namespace

Modules: V3 Classes: Extract, JsonPath, Merge

Class Method Summary collapse

Class Method Details

.extract(object_graph, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/pact/matching_rules.rb', line 10

def self.extract object_graph, options = {}
  pact_specification_version = options[:pact_specification_version] || Pact::SpecificationVersion::NIL_VERSION
  case pact_specification_version.major
  when nil, 0, 1, 2
    Extract.(object_graph)
  else
    V3::Extract.(object_graph)
  end
end

.merge(object_graph, matching_rules, options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/pact/matching_rules.rb', line 20

def self.merge object_graph, matching_rules, options = {}
  pact_specification_version = options[:pact_specification_version] || Pact::SpecificationVersion::NIL_VERSION
  case pact_specification_version.major
  when nil, 0, 1, 2
    Merge.(object_graph, matching_rules)
  else
    V3::Merge.(object_graph, matching_rules)
  end
end