Class: Pact::ConsumerContractDecorator
- Inherits:
-
Object
- Object
- Pact::ConsumerContractDecorator
- Includes:
- ActiveSupportSupport
- Defined in:
- lib/pact/consumer_contract/consumer_contract_decorator.rb
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(consumer_contract, decorator_options = {}) ⇒ ConsumerContractDecorator
constructor
A new instance of ConsumerContractDecorator.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(consumer_contract, decorator_options = {}) ⇒ ConsumerContractDecorator
Returns a new instance of ConsumerContractDecorator.
9 10 11 12 |
# File 'lib/pact/consumer_contract/consumer_contract_decorator.rb', line 9 def initialize consumer_contract, = {} @consumer_contract = consumer_contract @decorator_options = end |
Instance Method Details
#as_json(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pact/consumer_contract/consumer_contract_decorator.rb', line 14 def as_json( = {}) fix_all_the_things( consumer: consumer_contract.consumer.as_json, provider: consumer_contract.provider.as_json, interactions: sorted_interactions.collect{ |i| InteractionDecorator.new(i, @decorator_options).as_json}, metadata: { pactSpecification: { version: pact_specification_version } } ) end |
#to_json(options = {}) ⇒ Object
27 28 29 |
# File 'lib/pact/consumer_contract/consumer_contract_decorator.rb', line 27 def to_json( = {}) as_json.to_json() end |