Sha256: 3eb1eba0f89a9f40cf6e705e9edc5239d7c1cbbb2da5935b1aeb72a1c75999bc

Contents?: true

Size: 596 Bytes

Versions: 9

Compression:

Stored size: 596 Bytes

Contents

# Toplevel Pubnub module.
# frozen_string_literal: true

module Pubnub
  # Validator module that holds all validators modules
  module Validator
    # Validator for GetUser event
    module GetUser
      include CommonValidator

      def validate!
        return if @skip_validate

        validate_user!
      end

      private

      def validate_user!
        return unless @user_id.nil?

        raise(
          ArgumentError.new(
            object: self,
            message: 'data: Provide user_id.'
          ),
          'data: Provide user_id.'
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pubnub-4.3.0 lib/pubnub/validators/get_user.rb
pubnub-4.2.7 lib/pubnub/validators/get_user.rb
pubnub-4.2.6 lib/pubnub/validators/get_user.rb
pubnub-4.2.5 lib/pubnub/validators/get_user.rb
pubnub-4.2.4 lib/pubnub/validators/get_user.rb
pubnub-4.2.3 lib/pubnub/validators/get_user.rb
pubnub-4.2.2 lib/pubnub/validators/get_user.rb
pubnub-4.2.1 lib/pubnub/validators/get_user.rb
pubnub-4.2.0 lib/pubnub/validators/get_user.rb