Sha256: 43e0021668a8fa82c29ae0f2a2596765f68d5a80995cc10a5ac224164f1d88c8

Contents?: true

Size: 1.41 KB

Versions: 25

Compression:

Stored size: 1.41 KB

Contents

# Toplevel Pubnub module.
module Pubnub
  # Holds delete functionality
  class DeleteMessages < SingleEvent
    include Concurrent::Async
    include Pubnub::Validator::Delete

    def initialize(options, app)
      @event = :delete
      @telemetry_name = :l_hist
      super
    end

    private

    def current_operation
      Pubnub::Constants::OPERATION_DELETE
    end

    def parameters(signature = false)
      {
        start: @start,
        end: @end
      }.reject { |_, value| value.blank? }.merge(super(signature))
    end

    def path
      '/' + [
        'v3',
        'history',
        'sub-key',
        @subscribe_key,
        'channel',
        @channel
      ].join('/')
    end

    def valid_envelope(_parsed_response, req_res_objects)
      Pubnub::Envelope.new(
        event: @event,
        event_options: @given_options,
        timetoken: nil,
        status: {
          code: req_res_objects[:response].code,
          operation: Pubnub::Constants::OPERATION_DELETE,
          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

25 entries across 25 versions & 1 rubygems

Version Path
pubnub-5.1.1 lib/pubnub/events/delete_messages.rb
pubnub-5.1.0 lib/pubnub/events/delete_messages.rb
pubnub-5.0.0 lib/pubnub/events/delete_messages.rb
pubnub-4.8.0 lib/pubnub/events/delete_messages.rb
pubnub-4.7.1 lib/pubnub/events/delete_messages.rb
pubnub-4.7.0 lib/pubnub/events/delete_messages.rb
pubnub-4.6.2 lib/pubnub/events/delete_messages.rb
pubnub-4.6.1 lib/pubnub/events/delete_messages.rb
pubnub-4.6.0 lib/pubnub/events/delete_messages.rb
pubnub-4.5.0 lib/pubnub/events/delete_messages.rb
pubnub-4.4.0 lib/pubnub/events/delete_messages.rb
pubnub-4.3.0 lib/pubnub/events/delete_messages.rb
pubnub-4.2.7 lib/pubnub/events/delete_messages.rb
pubnub-4.2.6 lib/pubnub/events/delete_messages.rb
pubnub-4.2.5 lib/pubnub/events/delete_messages.rb
pubnub-4.2.4 lib/pubnub/events/delete_messages.rb
pubnub-4.2.3 lib/pubnub/events/delete_messages.rb
pubnub-4.2.2 lib/pubnub/events/delete_messages.rb
pubnub-4.2.1 lib/pubnub/events/delete_messages.rb
pubnub-4.2.0 lib/pubnub/events/delete_messages.rb