Class: Rapns::Apns::DeviceTokenFormatValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- Rapns::Apns::DeviceTokenFormatValidator
- Defined in:
- lib/rapns/apns/device_token_format_validator.rb
Instance Method Summary collapse
Methods inherited from ActiveModel::Validator
Constructor Details
This class inherits a constructor from ActiveModel::Validator
Instance Method Details
#validate(record) ⇒ Object
5 6 7 8 9 |
# File 'lib/rapns/apns/device_token_format_validator.rb', line 5 def validate(record) if record.device_token !~ /^[a-z0-9]{64,256}$/i record.errors.add(:device_token, "is invalid") end end |