Class: SalesforceArSync::SalesforceObjectSync
- Inherits:
-
Struct
- Object
- Struct
- SalesforceArSync::SalesforceObjectSync
- Defined in:
- lib/salesforce_ar_sync/salesforce_object_sync.rb
Overview
simple object to be serialized when asynchronously sending data to Salesforce
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#salesforce_id ⇒ Object
Returns the value of attribute salesforce_id.
-
#salesforce_object_name ⇒ Object
Returns the value of attribute salesforce_object_name.
-
#web_object_name ⇒ Object
Returns the value of attribute web_object_name.
Instance Method Summary collapse
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def attributes @attributes end |
#salesforce_id ⇒ Object
Returns the value of attribute salesforce_id
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def salesforce_id @salesforce_id end |
#salesforce_object_name ⇒ Object
Returns the value of attribute salesforce_object_name
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def salesforce_object_name @salesforce_object_name end |
#web_object_name ⇒ Object
Returns the value of attribute web_object_name
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def web_object_name @web_object_name end |
Instance Method Details
#perform ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 4 def perform sf_object = "Databasedotcom::#{salesforce_object_name}".constantize.find_by_Id salesforce_id if sf_object sf_object.update_attributes(attributes) sf_object.reload web_object = "#{web_object_name}".constantize.find_by_salesforce_id salesforce_id web_object.update_attribute(:salesforce_updated_at, sf_object.SystemModstamp) unless web_object.nil? end end |