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.
84 85 86 |
# File 'lib/simplepubsub.rb', line 84 def @message end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
84 85 86 |
# File 'lib/simplepubsub.rb', line 84 def proc @proc end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
84 85 86 |
# File 'lib/simplepubsub.rb', line 84 def topic @topic end |
Instance Method Details
#get(topic, options = {}, &get_proc) ⇒ Object
86 87 88 89 90 |
# File 'lib/simplepubsub.rb', line 86 def get(topic, ={}, &get_proc) @topic = 'subscribe to topic' @proc, @message = get_proc, topic end |
#publish(topic, message) ⇒ Object
92 93 94 95 96 |
# File 'lib/simplepubsub.rb', line 92 def publish(topic, ) @topic, @message = topic, @proc = ->(_,_){ :stop} end |