Class: Wamp::MessageHandler::Subscribed
- Inherits:
-
Base
- Object
- Base
- Wamp::MessageHandler::Subscribed
show all
- Defined in:
- lib/wamp/message_handler/subscribed.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#connection, #message
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #send_message
Instance Method Details
#alt_store_key ⇒ Object
20
21
22
|
# File 'lib/wamp/message_handler/subscribed.rb', line 20
def alt_store_key
"subscription_#{message.subscription_id}"
end
|
#handle ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/wamp/message_handler/subscribed.rb', line 7
def handle
validate_received_message
store[alt_store_key] = { handler: stored_data.fetch(:handler), topic: stored_data.fetch(:topic) }
store_topic
deliver_response(response)
end
|
#response ⇒ Object
16
17
18
|
# File 'lib/wamp/message_handler/subscribed.rb', line 16
def response
Type::Subscription.new(subscription_id: message.subscription_id)
end
|
#store_topic ⇒ Object
24
25
26
27
|
# File 'lib/wamp/message_handler/subscribed.rb', line 24
def store_topic
topic = stored_data.fetch(:topic)
store[topic] = message.subscription_id
end
|