Class: ValidatesIdentity
- Inherits:
-
Object
show all
- Defined in:
- lib/validates_identity.rb,
lib/validates_identity/version.rb,
lib/validates_identity/identity.rb,
lib/validates_identity/shoulda_matchers.rb
Defined Under Namespace
Classes: Identity, ShouldaMatchers
Constant Summary
collapse
- VERSION =
'1.0.0'
Class Method Summary
collapse
Class Method Details
.get_validator(identity_type, type: :both) ⇒ Object
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/validates_identity.rb', line 56
def self.get_validator(identity_type, type: :both)
identity_alias =
case type
when :person then person_identity_type_aliases[identity_type.to_sym]
when :legal then legal_identity_type_aliases[identity_type.to_sym]
else identity_type_aliases[identity_type.to_sym]
end
identity_types[identity_alias]
end
|
.register_legal_identity_type(identity_type_acronym, identity_type_validator) ⇒ Object
43
44
45
46
|
# File 'lib/validates_identity.rb', line 43
def self.register_legal_identity_type(identity_type_acronym, identity_type_validator)
legal_identity_types[identity_type_acronym.to_sym] = identity_type_validator
register_legal_identity_type_alias(identity_type_acronym, identity_type_acronym)
end
|
.register_legal_identity_type_alias(identity_type, identity_type_alias) ⇒ Object
52
53
54
|
# File 'lib/validates_identity.rb', line 52
def self.register_legal_identity_type_alias(identity_type, identity_type_alias)
legal_identity_type_aliases[identity_type_alias.to_sym] = identity_type.to_sym
end
|
.register_person_identity_type(identity_type_acronym, identity_type_validator) ⇒ Object
38
39
40
41
|
# File 'lib/validates_identity.rb', line 38
def self.register_person_identity_type(identity_type_acronym, identity_type_validator)
person_identity_types[identity_type_acronym.to_sym] = identity_type_validator
register_person_identity_type_alias(identity_type_acronym, identity_type_acronym)
end
|
.register_person_identity_type_alias(identity_type, identity_type_alias) ⇒ Object
48
49
50
|
# File 'lib/validates_identity.rb', line 48
def self.register_person_identity_type_alias(identity_type, identity_type_alias)
person_identity_type_aliases[identity_type_alias.to_sym] = identity_type.to_sym
end
|