Sha256: 6cd86087b8fe96e4a5c7831958736743ed145d490aa62f8837852ecec9e8ce05

Contents?: true

Size: 712 Bytes

Versions: 37

Compression:

Stored size: 712 Bytes

Contents

# Toplevel Pubnub module.
module Pubnub
  # Validator module that holds all validators modules
  module Validator
    # Validator for Audit event
    module Audit
      include CommonValidator

      def validate!
        return if @skip_validate
        validate_auth_key!
      end

      private

      def validate_auth_key!
        return unless @channel.size > 1 && @auth.to_s.count(',') > 0
        raise(
          ArgumentError.new(
            object: self,
            message: 'Invalid :auth_key. You can\'t run audit for multiple channels and keys at once'
          ),
          'Invalid :auth_key. You can\'t run audit for multiple channels and keys at once'
        )
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pubnub-5.5.0 lib/pubnub/validators/audit.rb
pubnub-5.4.0 lib/pubnub/validators/audit.rb
pubnub-5.3.5 lib/pubnub/validators/audit.rb
pubnub-5.3.4 lib/pubnub/validators/audit.rb
pubnub-5.3.3 lib/pubnub/validators/audit.rb
pubnub-5.3.2 lib/pubnub/validators/audit.rb
pubnub-5.3.1 lib/pubnub/validators/audit.rb
pubnub-5.3.0 lib/pubnub/validators/audit.rb
pubnub-5.2.2 lib/pubnub/validators/audit.rb
pubnub-5.2.1 lib/pubnub/validators/audit.rb
pubnub-5.2.0 lib/pubnub/validators/audit.rb
pubnub-5.1.2 lib/pubnub/validators/audit.rb
pubnub-5.1.1 lib/pubnub/validators/audit.rb
pubnub-5.1.0 lib/pubnub/validators/audit.rb
pubnub-5.0.0 lib/pubnub/validators/audit.rb
pubnub-4.8.0 lib/pubnub/validators/audit.rb
pubnub-4.7.1 lib/pubnub/validators/audit.rb
pubnub-4.7.0 lib/pubnub/validators/audit.rb
pubnub-4.6.2 lib/pubnub/validators/audit.rb
pubnub-4.6.1 lib/pubnub/validators/audit.rb