module Cabin::Publisher
This mixin allows you to easily give channel and publish features to a class.
Public Instance Methods
channel()
click to toggle source
Get the channel
# File lib/cabin/publisher.rb, line 12 def channel return @channel end
channel=(channel)
click to toggle source
Set the channel
# File lib/cabin/publisher.rb, line 7 def channel=(channel) @channel = channel end
publish(object)
click to toggle source
Publish to the channel
# File lib/cabin/publisher.rb, line 17 def publish(object) @channel << object end