kevintyll-ssn_validator 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +6 -0
- data/VERSION.yml +1 -1
- data/lib/ssn_validator/models/ssn_validator.rb +6 -1
- data/test/test_ssn_validator.rb +2 -0
- metadata +1 -1
data/History.txt
CHANGED
@@ -27,3 +27,9 @@
|
|
27
27
|
|
28
28
|
* 1 minor enhancement:
|
29
29
|
* Using jeweler gem to create gemspec and rdoc files
|
30
|
+
|
31
|
+
== 1.0.3 2009-04-24
|
32
|
+
|
33
|
+
* 2 minor enhancement:
|
34
|
+
* Added method #death_master_file_record to SsnValidator::Ssn to return the actual dmf record if the SSN exists
|
35
|
+
* Changed the method #death_master_file_hit? to simply return true or false.
|
data/VERSION.yml
CHANGED
@@ -61,9 +61,14 @@ module SsnValidator
|
|
61
61
|
@errors.empty?
|
62
62
|
end
|
63
63
|
|
64
|
+
#returns the death master record if there is one.
|
65
|
+
def death_master_file_record
|
66
|
+
DeathMasterFile.find_by_social_security_number(@ssn)
|
67
|
+
end
|
68
|
+
|
64
69
|
#Determines if the passed in ssn belongs to the deceased.
|
65
70
|
def death_master_file_hit?
|
66
|
-
|
71
|
+
!death_master_file_record.nil?
|
67
72
|
end
|
68
73
|
|
69
74
|
|
data/test/test_ssn_validator.rb
CHANGED
@@ -74,9 +74,11 @@ class TestSsnValidator < Test::Unit::TestCase
|
|
74
74
|
DeathMasterFileLoader.new(File.dirname(__FILE__) + '/files/test_dmf_initial_load.txt','2009-01-01').load_file
|
75
75
|
|
76
76
|
validator = SsnValidator::Ssn.new('772781978')#ssn from file
|
77
|
+
assert DeathMasterFile, validator.death_master_file_record.class
|
77
78
|
assert validator.death_master_file_hit?
|
78
79
|
|
79
80
|
validator = SsnValidator::Ssn.new('666781978')#ssn not in file
|
81
|
+
assert_nil validator.death_master_file_record
|
80
82
|
assert !validator.death_master_file_hit?
|
81
83
|
end
|
82
84
|
|