Module: AutotaskRuby::Response

Includes:
Constants
Included in:
CreateResponse, DeleteResponse, QueryResponse, ThresholdAndUsageInfoResponse, UpdateResponse
Defined in:
lib/autotask_ruby/response.rb

Constant Summary

Constants included from Constants

Constants::AUTOTASK_TIME_FORMAT

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entitiesObject

Returns the value of attribute entities.



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

def entities
  @entities
end

#entity_typeObject

Returns the value of attribute entity_type.



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

def entity_type
  @entity_type
end

#errorsObject

Returns the value of attribute errors.



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

def errors
  @errors
end

#return_codeObject

Returns the value of attribute return_code.



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

def return_code
  @return_code
end

Instance Method Details

#initialize(client, response) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/autotask_ruby/response.rb', line 8

def initialize(client, response)
  @client = client
  @entities = []
  @errors = response.xpath('//Autotask:Errors', Autotask: AutotaskRuby.configuration.namespace).text
  @return_code = response.xpath('//Autotask:ReturnCode', Autotask: AutotaskRuby.configuration.namespace).text.to_i
  @entity_type = response.xpath('//Autotask:EntityResultType', Autotask: AutotaskRuby.configuration.namespace).text.classify
  parse_entities(response.xpath('//Autotask:Entity', Autotask: AutotaskRuby.configuration.namespace))
end