Class: SimplePubSub::Client::PubSub
- Inherits:
-
Object
- Object
- SimplePubSub::Client::PubSub
- Defined in:
- lib/simplepubsub.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Instance Method Summary collapse
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
90 91 92 |
# File 'lib/simplepubsub.rb', line 90 def @message end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
90 91 92 |
# File 'lib/simplepubsub.rb', line 90 def proc @proc end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
90 91 92 |
# File 'lib/simplepubsub.rb', line 90 def topic @topic end |
Instance Method Details
#get(topic, options = {}, &get_proc) ⇒ Object
92 93 94 95 96 |
# File 'lib/simplepubsub.rb', line 92 def get(topic, ={}, &get_proc) @topic = 'subscribe to topic' @proc, @message = get_proc, topic end |
#publish(topic, message) ⇒ Object
98 99 100 101 102 |
# File 'lib/simplepubsub.rb', line 98 def publish(topic, ) @topic, @message = topic, @proc = ->(_,_){ :stop} end |