Class: SoapyCake::Response

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/soapy_cake/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#require_params, #validate_id, #walk_tree

Constructor Details

#initialize(body, addedit) ⇒ Response

Returns a new instance of Response.



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

def initialize(body, addedit)
  @body = body
  @addedit = addedit
end

Instance Attribute Details

#addeditObject (readonly)

Returns the value of attribute addedit.



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

def addedit
  @addedit
end

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#time_offsetObject

Returns the value of attribute time_offset.



5
6
7
# File 'lib/soapy_cake/response.rb', line 5

def time_offset
  @time_offset
end

Instance Method Details

#collectionObject



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

def collection
  check_errors!

  return typed_element(sax.at_depth(3).first) if addedit

  sax.at_depth(5).map do |element|
    typed_element(element)
  end
end