Class: Pact::Message::Consumer::InteractionDecorator
- Inherits:
-
Object
- Object
- Pact::Message::Consumer::InteractionDecorator
- Includes:
- ActiveSupportSupport
- Defined in:
- lib/pact/message/consumer/interaction_decorator.rb
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(message, decorator_options = {}) ⇒ InteractionDecorator
constructor
A new instance of InteractionDecorator.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(message, decorator_options = {}) ⇒ InteractionDecorator
Returns a new instance of InteractionDecorator.
10 11 12 13 |
# File 'lib/pact/message/consumer/interaction_decorator.rb', line 10 def initialize , = {} @message = @decorator_options = end |
Instance Method Details
#as_json(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/pact/message/consumer/interaction_decorator.rb', line 15 def as_json = {} hash = { :description => .description } hash[:providerStates] = provider_states hash[:contents] = extract_contents hash[:matchingRules] = extract_matching_rules hash[:metaData] = . || {} fix_all_the_things hash end |
#to_json(options = {}) ⇒ Object
24 25 26 |
# File 'lib/pact/message/consumer/interaction_decorator.rb', line 24 def to_json( = {}) as_json().to_json() end |