Class: ChimpSync::Subscriber
- Inherits:
-
Object
- Object
- ChimpSync::Subscriber
- Defined in:
- lib/chimp_sync/subscriber.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call(*arguments) ⇒ Object
-
#initialize(type, &block) ⇒ Subscriber
constructor
A new instance of Subscriber.
Constructor Details
#initialize(type, &block) ⇒ Subscriber
Returns a new instance of Subscriber.
10 11 12 |
# File 'lib/chimp_sync/subscriber.rb', line 10 def initialize(type, &block) @type, @block = type, block end |
Class Method Details
.add(*types, &block) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/chimp_sync/subscriber.rb', line 2 def self.add(*types, &block) types.each do |type| ActiveSupport::Notifications.subscribe("#{type}.panthoot") do |*args| new(type, &block).call *args end end end |