Class: PactBroker::Client::Hal::HttpClient::Response

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pact_broker/client/hal/http_client.rb

Instance Method Summary collapse

Instance Method Details

#bodyObject



77
78
79
80
81
82
83
84
# File 'lib/pact_broker/client/hal/http_client.rb', line 77

def body
  bod = raw_body
  if bod && bod != ''
    JSON.parse(bod)
  else
    nil
  end
end

#raw_bodyObject



86
87
88
# File 'lib/pact_broker/client/hal/http_client.rb', line 86

def raw_body
  __getobj__().body
end

#statusObject



90
91
92
# File 'lib/pact_broker/client/hal/http_client.rb', line 90

def status
  code.to_i
end

#success?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/pact_broker/client/hal/http_client.rb', line 94

def success?
  __getobj__().code.start_with?("2")
end