Class: Toot::RegistersSubscriptions

Inherits:
Object
  • Object
show all
Defined in:
lib/toot/registers_subscriptions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



15
16
17
# File 'lib/toot/registers_subscriptions.rb', line 15

def self.call(*args)
  new.call(*args)
end

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/toot/registers_subscriptions.rb', line 4

def call
  subscriptions = Toot.config
    .subscriptions
    .each_with_object({}) { |s, hash| hash[[s.source, s.channel]] = s }
    .values

  subscriptions.each do |subscription|
    register(subscription)
  end
end