Class: Icalia::Event::Publisher
- Inherits:
-
Object
- Object
- Icalia::Event::Publisher
- Defined in:
- lib/icalia/event/publisher.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Publisher
constructor
A new instance of Publisher.
- #publish(topic_name, data, attributes = {}) ⇒ Object
Constructor Details
#initialize ⇒ Publisher
Returns a new instance of Publisher.
33 34 35 36 |
# File 'lib/icalia/event/publisher.rb', line 33 def initialize initialize_pubsub_client initialize_logger end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
29 30 31 |
# File 'lib/icalia/event/publisher.rb', line 29 def client @client end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
29 30 31 |
# File 'lib/icalia/event/publisher.rb', line 29 def logger @logger end |
Class Method Details
.instance ⇒ Object
22 23 24 |
# File 'lib/icalia/event/publisher.rb', line 22 def instance @instance ||= new end |
Instance Method Details
#publish(topic_name, data, attributes = {}) ⇒ Object
38 39 40 41 |
# File 'lib/icalia/event/publisher.rb', line 38 def publish(topic_name, data, attributes = {}) logger.debug "Publishing to '#{topic_name}': #{data.inspect}" get_or_create_topic(topic_name).publish (data), attributes end |