class Slanger::Api::EventPublisher

Public Class Methods

publish(channels, event) click to toggle source
# File lib/slanger/api/event_publisher.rb, line 4
def self.publish(channels, event)
  new(channels, event).publish
end

Public Instance Methods

publish() click to toggle source
# File lib/slanger/api/event_publisher.rb, line 8
def publish
  Array(channels).each do |c|
    publish_event(c)
  end
end

Private Instance Methods

publish_event(channel_id) click to toggle source
# File lib/slanger/api/event_publisher.rb, line 16
def publish_event(channel_id)
  Slanger::Redis.publish(channel_id, event.payload(channel_id))
end