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, &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(*args) ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/simplepubsub.rb', line 98 def publish(*args) topic, = args.length > 1 ? args : args.first.split(':',2) @topic, @message = topic, @proc = ->(_,_){} end |