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



72
73
74
75
76
77
78
79
# File 'lib/pact_broker/client/hal/http_client.rb', line 72

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

#raw_bodyObject



81
82
83
# File 'lib/pact_broker/client/hal/http_client.rb', line 81

def raw_body
  __getobj__().body
end

#statusObject



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

def status
  code.to_i
end

#success?Boolean

Returns:

  • (Boolean)


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

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