Class: Shoulda::Matchers::ActiveModel::RequireAValidGuatemalaIdentityMatcher
- Inherits:
-
ValidationMatcher
- Object
- ValidationMatcher
- Shoulda::Matchers::ActiveModel::RequireAValidGuatemalaIdentityMatcher
- Defined in:
- lib/validates_guatemala_identity/require_a_valid_guatemala_identity_matcher.rb
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
13 14 15 |
# File 'lib/validates_guatemala_identity/require_a_valid_guatemala_identity_matcher.rb', line 13 def description 'requires a valid Guatemala Identity' end |
#failure_message ⇒ Object
17 18 19 |
# File 'lib/validates_guatemala_identity/require_a_valid_guatemala_identity_matcher.rb', line 17 def 'does not require a valid Guatemala Identity' end |
#matches?(subject) ⇒ Boolean
21 22 23 24 25 26 27 28 29 |
# File 'lib/validates_guatemala_identity/require_a_valid_guatemala_identity_matcher.rb', line 21 def matches?(subject) super(subject) allows_value_of('1234567891507') && allows_value_of('2345678990102') && disallows_value_of('1234567881507') && # invalid checksum disallows_value_of('1234567892307') && # invalid state code disallows_value_of('1234567891618') # invalid city code end |