Class: Handsoap::Http::Response

Inherits:
Part
  • Object
show all
Defined in:
lib/handsoap/http.rb

Overview

Represents a HTTP Response.

Instance Attribute Summary collapse

Attributes inherited from Part

#body, #headers, #parts

Instance Method Summary collapse

Methods inherited from Part

#[], #charset, #inspect, #mime_type, #multipart?

Constructor Details

#initialize(status, headers, body, parts = nil) ⇒ Response

Returns a new instance of Response.



114
115
116
117
# File 'lib/handsoap/http.rb', line 114

def initialize(status, headers, body, parts = nil)
  @status = status.to_i
  super(headers, body, parts)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



113
114
115
# File 'lib/handsoap/http.rb', line 113

def status
  @status
end

Instance Method Details

#primary_partObject



118
119
120
121
122
123
124
125
# File 'lib/handsoap/http.rb', line 118

def primary_part
  # Strictly speaking, the main part doesn't need to be first, but until proven otherwise, we'll just assume that.
  if multipart?
    parts.first
  else
    self
  end
end