Class: PactBroker::Webhooks::HttpResponseWithUtf8SafeBody
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- PactBroker::Webhooks::HttpResponseWithUtf8SafeBody
- Defined in:
- lib/pact_broker/webhooks/http_response_with_utf_8_safe_body.rb
Instance Method Summary collapse
Instance Method Details
#body ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/pact_broker/webhooks/http_response_with_utf_8_safe_body.rb', line 4 def body if unsafe_body unsafe_body.encode("UTF-8", "binary", invalid: :replace, undef: :replace, replace: "") else unsafe_body end end |
#unsafe_body ⇒ Object
12 13 14 |
# File 'lib/pact_broker/webhooks/http_response_with_utf_8_safe_body.rb', line 12 def unsafe_body __getobj__().body end |
#unsafe_body? ⇒ Boolean
16 17 18 |
# File 'lib/pact_broker/webhooks/http_response_with_utf_8_safe_body.rb', line 16 def unsafe_body? unsafe_body != body end |