Sha256: 10276afbc145dcdd7833bf1bbab4dd999163eb9a45301fb9ccc827c6c6aa37fa

Contents?: true

Size: 897 Bytes

Versions: 8

Compression:

Stored size: 897 Bytes

Contents

module Pubnub
  class Audit
    include Pubnub::Event
    include Pubnub::SingleEvent
    include Pubnub::Formatter
    include Pubnub::Validator
    include Pubnub::PAM

    def initialize(options, app)
      super
      @event = 'audit'
      @allow_multiple_channels = false
      @timestamp = current_time
    end

    def validate!
      raise ArgumentError.new(:object => self, :message => 'publish_key is required by Audit') unless @publish_key
      raise ArgumentError.new(:object => self, :message => 'Parameter secret_key is required by Audit') if !@secret_key || @secret_key == 0

    end

    private

    def parameters(app, signature = false)
      { :timestamp => @timestamp }.merge(super(app, signature))
    end

    def path(app)
      '/' + [
          'v1',
          'auth',
          'audit',
          'sub-key',
          @subscribe_key
      ].join('/')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pubnub-3.5.14 lib/pubnub/events/audit.rb
pubnub-3.5.12 lib/pubnub/events/audit.rb
pubnub-3.5.8 lib/pubnub/events/audit.rb
pubnub-3.5.7 lib/pubnub/events/audit.rb
pubnub-3.5.6 lib/pubnub/events/audit.rb
pubnub-3.5.5 lib/pubnub/events/audit.rb
pubnub-3.5.3 lib/pubnub/events/audit.rb
pubnub-3.5.1 lib/pubnub/events/audit.rb