Class: Pact::ResponseDecorator
- Inherits:
-
Object
- Object
- Pact::ResponseDecorator
- Defined in:
- lib/pact/consumer_contract/response_decorator.rb
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(response, decorator_options = {}) ⇒ ResponseDecorator
constructor
A new instance of ResponseDecorator.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(response, decorator_options = {}) ⇒ ResponseDecorator
Returns a new instance of ResponseDecorator.
7 8 9 10 |
# File 'lib/pact/consumer_contract/response_decorator.rb', line 7 def initialize response, = {} @response = response @decorator_options = end |
Instance Method Details
#as_json(options = {}) ⇒ Object
16 17 18 |
# File 'lib/pact/consumer_contract/response_decorator.rb', line 16 def as_json = {} include_matching_rules? ? with_matching_rules(attributes_hash) : attributes_hash end |
#to_json(options = {}) ⇒ Object
12 13 14 |
# File 'lib/pact/consumer_contract/response_decorator.rb', line 12 def to_json( = {}) as_json.to_json() end |