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.
70 71 72 |
# File 'lib/simplepubsub.rb', line 70 def end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
70 71 72 |
# File 'lib/simplepubsub.rb', line 70 def proc @proc end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
70 71 72 |
# File 'lib/simplepubsub.rb', line 70 def topic @topic end |
Instance Method Details
#get(topic, options = {}, &get_proc) ⇒ Object
72 73 74 75 76 |
# File 'lib/simplepubsub.rb', line 72 def get(topic, ={}, &get_proc) @topic = 'subscribe to topic' @proc, = get_proc, topic end |
#publish(topic, message) ⇒ Object
78 79 80 81 82 |
# File 'lib/simplepubsub.rb', line 78 def publish(topic, ) @topic, = topic, @proc = ->(_,_){ :stop} end |