Class: SubPub::ActiveRecord::Publisher

Inherits:
Object
  • Object
show all
Defined in:
lib/sub_pub/active_record/publisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(record, callback) ⇒ Publisher

Returns a new instance of Publisher.



5
6
7
8
# File 'lib/sub_pub/active_record/publisher.rb', line 5

def initialize(record, callback)
  @record = record
  @callback = callback
end

Instance Method Details

#publish_callback_notificationObject



10
11
12
# File 'lib/sub_pub/active_record/publisher.rb', line 10

def publish_callback_notification
  publish_notification(callback_notification)
end

#publish_changed_attribute_notificationsObject



14
15
16
17
# File 'lib/sub_pub/active_record/publisher.rb', line 14

def publish_changed_attribute_notifications
  notification = changes_notification
  publish_notification(notification) if notification
end