Sha256: b8d0bef58544c0e0d6f724911fd116218fe1caed2ee1ce07fb4c8dd47f81a6cb

Contents?: true

Size: 345 Bytes

Versions: 9

Compression:

Stored size: 345 Bytes

Contents

module Rpush
  module Client
    module ActiveModel
      module Apns
        class DeviceTokenFormatValidator < ::ActiveModel::Validator
          def validate(record)
            return if record.device_token =~ /\A[a-z0-9]\w+\z/i
            record.errors.add :device_token, "is invalid"
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rpush-9.1.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-9.0.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-8.0.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-7.0.1 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-7.0.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-6.0.1 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-6.0.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-5.4.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb
rpush-5.3.0 lib/rpush/client/active_model/apns/device_token_format_validator.rb