Sha256: 1f3b12627b4de7fa3449bf415b3a5088bcc891440687030f4a429fd3cc3ce0f5

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

module Wamp
  module MessageHandler
    # Receive unsubscribed
    class Unsubscribed < Base
      def handle
        validate_received_message
        delete_topic store.delete(alt_store_key)

        deliver_response(response)
      end

      def response
        Type::Success.new
      end

      private

      def alt_store_key
        "subscription_#{subscription_id}"
      end

      def delete_topic(data)
        store.delete data.fetch(:topic)
      end

      def subscription_id
        stored_data.fetch(:subscription_id)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xconn-0.1.2 lib/wamp/message_handler/unsubscribed.rb
xconn-0.1.1 lib/wamp/message_handler/unsubscribed.rb
xconn-0.1.0 lib/wamp/message_handler/unsubscribed.rb