Class: PubsubClient::SubscriberFactory
- Inherits:
-
Object
- Object
- PubsubClient::SubscriberFactory
- Defined in:
- lib/pubsub_client/subscriber_factory.rb
Instance Method Summary collapse
- #build(subscription_name) ⇒ Object
-
#initialize ⇒ SubscriberFactory
constructor
A new instance of SubscriberFactory.
Constructor Details
#initialize ⇒ SubscriberFactory
Returns a new instance of SubscriberFactory.
7 8 9 |
# File 'lib/pubsub_client/subscriber_factory.rb', line 7 def initialize @subscribers = {} end |
Instance Method Details
#build(subscription_name) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/pubsub_client/subscriber_factory.rb', line 13 def build(subscription_name) if @subscribers.key?(subscription_name) raise ConfigurationError, "PubsubClient already subscribed to #{subscription_name}" end @subscribers[subscription_name] = build_subscriber(subscription_name) end |