Class: Pact::RequestDecorator
- Inherits:
-
Object
- Object
- Pact::RequestDecorator
- Defined in:
- lib/pact/consumer_contract/request_decorator.rb
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(request, decorator_options = {}) ⇒ RequestDecorator
constructor
A new instance of RequestDecorator.
- #to_json(options = {}) ⇒ Object
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, = {} @request = request @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 = {} 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( = {}) as_json.to_json() end |