Class: SOAP::NetHttpClient::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/soap/netHttpClient.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, reason, contenttype, content) ⇒ Response

Returns a new instance of Response.



223
224
225
226
227
228
# File 'lib/soap/netHttpClient.rb', line 223

def initialize(status, reason, contenttype, content)
  @status = status
  @reason = reason
  @contenttype = contenttype
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



221
222
223
# File 'lib/soap/netHttpClient.rb', line 221

def content
  @content
end

#contenttypeObject (readonly)

Returns the value of attribute contenttype.



220
221
222
# File 'lib/soap/netHttpClient.rb', line 220

def contenttype
  @contenttype
end

#reasonObject (readonly)

Returns the value of attribute reason.



219
220
221
# File 'lib/soap/netHttpClient.rb', line 219

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



218
219
220
# File 'lib/soap/netHttpClient.rb', line 218

def status
  @status
end

Class Method Details

.from_httpresponse(res) ⇒ Object



230
231
232
233
234
235
236
# File 'lib/soap/netHttpClient.rb', line 230

def self.from_httpresponse(res)
  status = res.code.to_i
  reason = res.message
  contenttype = res['content-type']
  content = res.body
  new(status, reason, contenttype, content)
end