Class: Markety::Response::SyncMultipleLeadsResponse

Inherits:
GenericResponse show all
Defined in:
lib/markety/response/sync_multiple_leads_response.rb

Overview

Response class for SyncLead commands

Instance Attribute Summary

Attributes inherited from GenericResponse

#error_message

Instance Method Summary collapse

Methods inherited from GenericResponse

#success?, #to_hash, #to_xml

Constructor Details

#initialize(response) ⇒ SyncMultipleLeadsResponse

Returns a new instance of SyncMultipleLeadsResponse.



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

def initialize(response)
  super(:sync_multiple_leads_response, response)
end

Instance Method Details

#lead_responsesObject



10
11
12
13
14
# File 'lib/markety/response/sync_multiple_leads_response.rb', line 10

def lead_responses
  response_hashes.map do |response_hash|
    LeadResponse.new(response_hash)
  end
end

#response_hashesObject



16
17
18
# File 'lib/markety/response/sync_multiple_leads_response.rb', line 16

def response_hashes
  [to_hash.fetch(:success_sync_multiple_leads, {}).fetch(:result, {}).fetch(:sync_status_list, {}).fetch(:sync_status, {})].flatten
end