Sha256: a4a13b8a56c84c9b7df1c5b46a3e6daa1f080ec79d594b5d91bda4b58efbac23

Contents?: true

Size: 687 Bytes

Versions: 7

Compression:

Stored size: 687 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!
        fail(
          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'
        ) if @channel.size > 1 && @auth.count(',') > 0
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pubnub-3.8.5 lib/pubnub/validators/audit.rb
pubnub-3.8.4 lib/pubnub/validators/audit.rb
pubnub-3.8.2 lib/pubnub/validators/audit.rb
pubnub-4.0.0beta2 lib/pubnub/validators/audit.rb
pubnub-4.0.0beta1 lib/pubnub/validators/audit.rb
pubnub-3.8.1 lib/pubnub/validators/audit.rb
pubnub-3.8.0 lib/pubnub/validators/audit.rb