Module: Cabin::Publisher
Overview
This mixin allows you to easily give channel and publish features to a class.
Instance Method Summary collapse
-
#channel ⇒ Object
Get the channel.
-
#channel=(channel) ⇒ Object
Set the channel.
-
#publish(object) ⇒ Object
Publish to the channel.
Instance Method Details
#channel ⇒ Object
Get the channel
12 13 14 |
# File 'lib/cabin/publisher.rb', line 12 def channel return @channel end |
#channel=(channel) ⇒ Object
Set the channel
7 8 9 |
# File 'lib/cabin/publisher.rb', line 7 def channel=(channel) @channel = channel end |
#publish(object) ⇒ Object
Publish to the channel
17 18 19 |
# File 'lib/cabin/publisher.rb', line 17 def publish(object) @channel << object end |