Class: Pact::RequestDecorator

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

Instance Method Summary collapse

Constructor Details

#initialize(request, decorator_options = {}) ⇒ RequestDecorator

Returns a new instance of RequestDecorator.



6
7
8
9
# File 'lib/pact/consumer_contract/request_decorator.rb', line 6

def initialize request, decorator_options = {}
  @request = request
  @decorator_options = decorator_options
end

Instance Method Details

#as_json(options = {}) ⇒ Object



15
16
17
18
# File 'lib/pact/consumer_contract/request_decorator.rb', line 15

def as_json options = {}
  hash = to_hash_without_rules
  include_matching_rules? ? with_matching_rules(hash) : hash
end

#to_json(options = {}) ⇒ Object



11
12
13
# File 'lib/pact/consumer_contract/request_decorator.rb', line 11

def to_json(options = {})
  as_json.to_json(options)
end