Class: Pact::InteractionDecorator
- Inherits:
-
Object
- Object
- Pact::InteractionDecorator
- Includes:
- ActiveSupportSupport
- Defined in:
- lib/pact/consumer_contract/interaction_decorator.rb
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(interaction, decorator_options = {}) ⇒ InteractionDecorator
constructor
A new instance of InteractionDecorator.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(interaction, decorator_options = {}) ⇒ InteractionDecorator
Returns a new instance of InteractionDecorator.
10 11 12 13 |
# File 'lib/pact/consumer_contract/interaction_decorator.rb', line 10 def initialize interaction, = {} @interaction = interaction @decorator_options = end |
Instance Method Details
#as_json(options = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/pact/consumer_contract/interaction_decorator.rb', line 15 def as_json = {} hash = { :description => interaction.description } hash[:providerState] = interaction.provider_state if interaction.provider_state hash[:request] = decorate_request.as_json() hash[:response] = decorate_response.as_json() fix_all_the_things hash end |
#to_json(options = {}) ⇒ Object
23 24 25 |
# File 'lib/pact/consumer_contract/interaction_decorator.rb', line 23 def to_json( = {}) as_json().to_json() end |