Class: SalesforceStreamer::SalesforceTopicManager

Inherits:
Object
  • Object
show all
Defined in:
lib/salesforce_streamer/salesforce_topic_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_topicsObject (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