Sha256: 0bc4bd49a298bb10101fe69cb0054b82fc75f24284d5fe663318ea22a0da2190
Contents?: true
Size: 1.93 KB
Versions: 7
Compression:
Stored size: 1.93 KB
Contents
# Toplevel Pubnub module. # frozen_string_literal: true module Pubnub # Holds RemoveUuidMetadata functionality class RemoveUuidMetadata < SingleEvent include Concurrent::Async include Pubnub::Validator::RemoveUuidMetadata def initialize(options, app) @event = current_operation @telemetry_name = :l_obj @uuid = options[:uuid].nil? ? app.user_id : options[:uuid] super end def fire Pubnub.logger.debug('Pubnub::RemoveUuidMetadata') { "Fired event #{self.class}" } body = Formatter.format_message(@data, nil, false) response = send_request(body) envelopes = fire_callbacks(handle(response, uri)) finalize_event(envelopes) envelopes end private def current_operation Pubnub::Constants::OPERATION_REMOVE_UUID_METADATA end def path '/' + [ 'v2', 'objects', @subscribe_key, 'uuids', Formatter.encode(@uuid) ].join('/') end def valid_envelope(parsed_response, req_res_objects) Pubnub::Envelope.new( event: @event, event_options: @given_options, timetoken: nil, result: { code: req_res_objects[:response].code, operation: current_operation, client_request: req_res_objects[:request], server_response: req_res_objects[:response], data: parsed_response }, status: { code: req_res_objects[:response].code, operation: current_operation, client_request: req_res_objects[:request], server_response: req_res_objects[:response], data: nil, category: Pubnub::Constants::STATUS_ACK, error: false, auto_retried: false, current_timetoken: nil, last_timetoken: nil, subscribed_channels: nil, subscribed_channel_groups: nil, config: get_config } ) end end end
Version data entries
7 entries across 7 versions & 1 rubygems