class Markety::Response::ResponseFactory

Factory that creates the appropriate Response object depending on the command type

Public Class Methods

create_response(cmd_type,savon_response) click to toggle source

Create the appropriate Response object depending on the command type

# File lib/markety/response/response_factory.rb, line 13
def self.create_response(cmd_type,savon_response)
  case cmd_type
    when :get_lead
      GetLeadResponse.new(savon_response)
    when :sync_lead
      SyncLeadResponse.new(savon_response)
    when :sync_multiple_leads
      SyncMultipleLeadsResponse.new(savon_response)
    when :list_operation
      ListOperationResponse.new(savon_response)
    when :get_custom_objects
      GetCustomObjectResponse.new(savon_response)
    when :sync_custom_objects
      SyncCustomObjectResponse.new(savon_response)
    else
      GenericResponse.new(cmd_type,savon_response)
  end
end