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

#messageObject (readonly)

Returns the value of attribute message.



70
71
72
# File 'lib/simplepubsub.rb', line 70

def message
  @message
end

#procObject (readonly)

Returns the value of attribute proc.



70
71
72
# File 'lib/simplepubsub.rb', line 70

def proc
  @proc
end

#topicObject (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, options={}, &get_proc)

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

#publish(topic, message) ⇒ Object



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

def publish(topic, message)

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