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

#const_lookup, #require_params, #translate_booleans!, #translate_values!, #validate_id, #walk_tree

Constructor Details

#initialize(body, short_response) ⇒ Response

Returns a new instance of Response.



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

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#short_responseObject (readonly)

Returns the value of attribute short_response.



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

def short_response
  @short_response
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 short_response

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