Class: Draisine::SoapHandler
- Inherits:
-
Object
- Object
- Draisine::SoapHandler
- Defined in:
- lib/draisine/soap_handler.rb
Constant Summary collapse
- InvalidOrganizationError =
Class.new(StandardError)
Instance Method Summary collapse
- #delete(message_xml) ⇒ Object
-
#initialize ⇒ SoapHandler
constructor
A new instance of SoapHandler.
- #update(message_xml) ⇒ Object
Constructor Details
#initialize ⇒ SoapHandler
Returns a new instance of SoapHandler.
8 9 |
# File 'lib/draisine/soap_handler.rb', line 8 def initialize end |
Instance Method Details
#delete(message_xml) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/draisine/soap_handler.rb', line 24 def delete() = parse() () extract_sobjects().each do |sobject| type = sobject.fetch('Object_Type__c') id = sobject.fetch('Object_Id__c') klass = Draisine.registry.find(type) klass.salesforce_on_inbound_delete(id) end rescue InvalidOrganizationError => e Draisine.invalid_organization_handler.call() end |
#update(message_xml) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/draisine/soap_handler.rb', line 11 def update() = parse() () extract_sobjects().each do |sobject| type = sobject.fetch('xsi:type').sub('sf:', '') klass = Draisine.registry.find(type) klass.salesforce_on_inbound_update(sobject) end rescue InvalidOrganizationError => e Draisine.invalid_organization_handler.call() end |