Class: Markety::Response::ResponseFactory
- Inherits:
-
Object
- Object
- Markety::Response::ResponseFactory
- Defined in:
- lib/markety/response/response_factory.rb
Overview
Factory that creates the appropriate Response object depending on the command type
Class Method Summary collapse
-
.create_response(cmd_type, savon_response) ⇒ Object
Create the appropriate Response object depending on the command type.
Class Method Details
.create_response(cmd_type, savon_response) ⇒ Object
Create the appropriate Response object depending on the command type
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# 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 |