Class: Savon::Multipart::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/savon/multipart/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Response

Returns a new instance of Response.



8
9
10
11
# File 'lib/savon/multipart/response.rb', line 8

def initialize(*args)
  @parts = []
  super
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



6
7
8
# File 'lib/savon/multipart/response.rb', line 6

def parts
  @parts
end

Instance Method Details

#attachmentsObject



13
14
15
16
17
18
19
20
# File 'lib/savon/multipart/response.rb', line 13

def attachments
  if multipart?
    parse_body unless @has_parsed_body
    @parts.attachments
  else
    []
  end
end

#xmlObject



22
23
24
25
26
27
28
29
# File 'lib/savon/multipart/response.rb', line 22

def xml
  if multipart?
    parse_body unless @has_parsed_body
    @parts.first.body.to_s
  else
    super
  end
end