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.



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

def message
  @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, options={}, &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, message)

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