Class: PactBroker::Client::Hal::HttpClient::Response
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- PactBroker::Client::Hal::HttpClient::Response
- Defined in:
- lib/pact_broker/client/hal/http_client.rb
Instance Method Summary collapse
- #body ⇒ Object
- #header(name) ⇒ Object
- #headers ⇒ Object
- #raw_body ⇒ Object
- #status ⇒ Object
- #success? ⇒ Boolean
Instance Method Details
#body ⇒ Object
177 178 179 180 181 182 183 184 |
# File 'lib/pact_broker/client/hal/http_client.rb', line 177 def body bod = raw_body if bod && bod != '' JSON.parse(bod) else nil end end |
#header(name) ⇒ Object
190 191 192 |
# File 'lib/pact_broker/client/hal/http_client.rb', line 190 def header(name) __getobj__()[name] end |
#headers ⇒ Object
186 187 188 |
# File 'lib/pact_broker/client/hal/http_client.rb', line 186 def headers __getobj__().to_hash end |
#raw_body ⇒ Object
194 195 196 |
# File 'lib/pact_broker/client/hal/http_client.rb', line 194 def raw_body __getobj__().body end |
#status ⇒ Object
198 199 200 |
# File 'lib/pact_broker/client/hal/http_client.rb', line 198 def status code.to_i end |
#success? ⇒ Boolean
202 203 204 |
# File 'lib/pact_broker/client/hal/http_client.rb', line 202 def success? __getobj__().code.start_with?("2") end |