Class: SimplePubSub::Client::PubSub

Inherits:
Object
  • Object
show all
Defined in:
lib/simplepubsub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#message ⇒ Object (readonly)

Returns the value of attribute message.



80
81
82
# File 'lib/simplepubsub.rb', line 80

def message
  @message
end

#proc ⇒ Object (readonly)

Returns the value of attribute proc.



80
81
82
# File 'lib/simplepubsub.rb', line 80

def proc
  @proc
end

#topic ⇒ Object (readonly)

Returns the value of attribute topic.



80
81
82
# File 'lib/simplepubsub.rb', line 80

def topic
  @topic
end

Instance Method Details

#get(topic, options = {}, &get_proc) ⇒ Object



82
83
84
85
86
# File 'lib/simplepubsub.rb', line 82

def get(topic, options={}, &get_proc)

  @topic = 'subscribe to topic'
  @proc, @message = get_proc, topic
end

#publish(topic, message) ⇒ Object



88
89
90
91
92
# File 'lib/simplepubsub.rb', line 88

def publish(topic, message)

  @topic, @message = topic, message
  @proc = ->(_,_){ :stop}
end