Class: Pact::InteractionParser

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/consumer_contract/interaction_parser.rb

Class Method Summary collapse

Class Method Details

.call(hash, options = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/pact/consumer_contract/interaction_parser.rb', line 7

def self.call hash, options = {}
  pact_specification_version = options[:pact_specification_version] || Pact::SpecificationVersion::NIL_VERSION
  case pact_specification_version.major
  when nil, 0, 1, 2 then parse_v2_interaction(hash, pact_specification_version: pact_specification_version)
  else parse_v3_interaction(hash, pact_specification_version: pact_specification_version)
  end
end

.parse_v2_interaction(hash, options) ⇒ Object



15
16
17
# File 'lib/pact/consumer_contract/interaction_parser.rb', line 15

def self.parse_v2_interaction hash, options
  InteractionV2Parser.call(hash, options)
end

.parse_v3_interaction(hash, options) ⇒ Object



19
20
21
# File 'lib/pact/consumer_contract/interaction_parser.rb', line 19

def self.parse_v3_interaction hash, options
  InteractionV3Parser.call(hash, options)
end