module Wisperable::Model
Private Instance Methods
broadcast_after_created()
click to toggle source
# File lib/wisperable.rb, line 45 def broadcast_after_created broadcast("#{publish_key}_created", self) if event_enabled?(:created) end
broadcast_after_destroyed()
click to toggle source
# File lib/wisperable.rb, line 53 def broadcast_after_destroyed broadcast("#{publish_key}_destroyed", attributes) if event_enabled?(:destroyed) end
broadcast_after_updated()
click to toggle source
# File lib/wisperable.rb, line 49 def broadcast_after_updated broadcast("#{publish_key}_updated", self, previous_changes) if event_enabled?(:updated) end
event_enabled?(event)
click to toggle source
# File lib/wisperable.rb, line 41 def event_enabled?(event) events.include?(event) end
events()
click to toggle source
# File lib/wisperable.rb, line 33 def events opts[:events] || [] end
opts()
click to toggle source
# File lib/wisperable.rb, line 29 def opts self.class.wisperable_opts || {} end
publish_key()
click to toggle source
# File lib/wisperable.rb, line 37 def publish_key opts[:publish_key] || self.class.model_name.param_key end