Class: SalesforceStreamer::SalesforceTopicManager
- Inherits:
-
Object
- Object
- SalesforceStreamer::SalesforceTopicManager
- Defined in:
- lib/salesforce_streamer/salesforce_topic_manager.rb
Instance Attribute Summary collapse
-
#push_topics ⇒ Object
readonly
Returns the value of attribute push_topics.
Instance Method Summary collapse
-
#initialize(push_topics:) ⇒ SalesforceTopicManager
constructor
A new instance of SalesforceTopicManager.
- #upsert_topics! ⇒ Object
Constructor Details
#initialize(push_topics:) ⇒ SalesforceTopicManager
Returns a new instance of SalesforceTopicManager.
5 6 7 8 |
# File 'lib/salesforce_streamer/salesforce_topic_manager.rb', line 5 def initialize(push_topics:) @push_topics = push_topics @client = SalesforceClient.new end |
Instance Attribute Details
#push_topics ⇒ Object (readonly)
Returns the value of attribute push_topics.
3 4 5 |
# File 'lib/salesforce_streamer/salesforce_topic_manager.rb', line 3 def push_topics @push_topics end |
Instance Method Details
#upsert_topics! ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/salesforce_streamer/salesforce_topic_manager.rb', line 10 def upsert_topics! Log.info 'Starting to upsert PushTopic definitions into Salesforce' @push_topics.each do |push_topic| Log.info push_topic.name Log.debug push_topic.attributes.to_json upsert(push_topic) if diff?(push_topic) end end |