Class: PubSub::SubscriptionsList
- Inherits:
-
Object
- Object
- PubSub::SubscriptionsList
- Includes:
- Singleton
- Defined in:
- lib/pub_sub/subscriptions_list.rb
Instance Attribute Summary collapse
-
#event_store ⇒ Object
Returns the value of attribute event_store.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ SubscriptionsList
constructor
A new instance of SubscriptionsList.
- #lint! ⇒ Object
- #load! ⇒ Object
Constructor Details
#initialize ⇒ SubscriptionsList
Returns a new instance of SubscriptionsList.
38 39 40 |
# File 'lib/pub_sub/subscriptions_list.rb', line 38 def initialize @domain_subscriptions = YAML.load_file(self.class.config_path) end |
Instance Attribute Details
#event_store ⇒ Object
Returns the value of attribute event_store.
20 21 22 |
# File 'lib/pub_sub/subscriptions_list.rb', line 20 def event_store @event_store end |
Class Method Details
.lint! ⇒ Object
16 17 18 |
# File 'lib/pub_sub/subscriptions_list.rb', line 16 def self.lint! instance.lint! end |
.load!(event_store) ⇒ Object
11 12 13 14 |
# File 'lib/pub_sub/subscriptions_list.rb', line 11 def self.load!(event_store) instance.event_store = event_store instance.load! end |
Instance Method Details
#lint! ⇒ Object
34 35 36 |
# File 'lib/pub_sub/subscriptions_list.rb', line 34 def lint! SubscriptionsLinter.new(domain_subscriptions).lint! end |
#load! ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pub_sub/subscriptions_list.rb', line 22 def load! domain_subscriptions.each do |domain_name, subscriptions| subscriptions.each do |event_name, subscription_type| if event_name == 'all_events' subscribe_to_all_events(domain_name, subscription_type) else subscribe_to_event(domain_name, event_name, subscription_type) end end end end |