Class: Pact::ResponseDecorator

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

Instance Method Summary collapse

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, decorator_options = {}
  @response = response
  @decorator_options = 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 options = {}
  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(options = {})
  as_json.to_json(options)
end