Class: Qup::Publisher
- Inherits:
-
Object
- Object
- Qup::Publisher
- Defined in:
- lib/qup/publisher.rb
Overview
Public: A Publisher produces messages on a Topic
Example:
pub = topic.publisher
pub.publish( )
Instance Attribute Summary collapse
-
#topic ⇒ Object
readonly
Public: The Topic this Publisher publishes to.
Instance Method Summary collapse
-
#initialize(topic) ⇒ Publisher
constructor
Public: Create a new Publisher for a Topic.
-
#publish(message) ⇒ Object
Public: Publish a Message to all the Subscribers.
Constructor Details
#initialize(topic) ⇒ Publisher
Public: Create a new Publisher for a Topic
Returns a Publisher
17 18 19 |
# File 'lib/qup/publisher.rb', line 17 def initialize( topic ) @topic = topic end |
Instance Attribute Details
#topic ⇒ Object (readonly)
Public: The Topic this Publisher publishes to.
12 13 14 |
# File 'lib/qup/publisher.rb', line 12 def topic @topic end |
Instance Method Details
#publish(message) ⇒ Object
Public: Publish a Message to all the Subscribers
message - the Object to send to all Subscribers.
Returns nothing
26 27 28 |
# File 'lib/qup/publisher.rb', line 26 def publish( ) @topic.publish( ) end |