Class: MiniDefender::Rules::NationalId

Inherits:
Luhn show all
Defined in:
lib/mini_defender/rules/national_id.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Luhn

#coerce, #passes?, valid_luhn?

Methods inherited from MiniDefender::Rule

#active?, available?, #bails?, #coerce, #default_value, #defaults?, #error_message, #excluded?, #force_coerce?, #implicit?, make, #passes?, #priority, #stops?, #with_message

Class Method Details

.signatureObject



6
7
8
# File 'lib/mini_defender/rules/national_id.rb', line 6

def self.signature
  'national_id'
end

Instance Method Details

#message(attribute, value, validator) ⇒ Object



10
11
12
# File 'lib/mini_defender/rules/national_id.rb', line 10

def message(attribute, value, validator)
  'The value must be a proper national ID number.'
end