mla_active_duty_status 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/README.md +14 -18
- data/lib/mla_active_duty_status/applicant.rb +2 -3
- data/lib/mla_active_duty_status/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed85cc4ed9b8ac963eca6e38f4d075ebbb684217
|
4
|
+
data.tar.gz: 4a4cae7b39f10a79604df24e41717b88db2c7b3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe4803c8f8bc7ce4683dd33e2fe8126a0fbdd7e4d8a8c6e48d0f7e3bbe8d2aa5f6cbb28e6beb40d0d519af5d60b00171847df1dd50f273dee396f4d7a8430f21
|
7
|
+
data.tar.gz: e136ff2fc5709f69d7504d7bbc3fa9038447649f3f7c3d5bc621dce5d60d7a840877ac00ee92e2f1e76fab0195eef79aa3149516a6e8aa18db8eb87262e5a6a6
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
 Tested on ruby 2.3.0 and jruby 1.7.
|
4
4
|
|
5
|
+
[](https://badge.fury.io/rb/mla_active_duty_status)
|
6
|
+
|
5
7
|
The Military Lending Act requires lenders in certain situations to check the active duty status of the loan applicant.
|
6
8
|
This gem uses [Mechanize](https://github.com/sparklemotion/mechanize) to screenscrape the MLA website providing the applicant details and returns a coded response for the active duty status
|
7
9
|
and the MLA PDF certificate.
|
@@ -37,36 +39,30 @@ The MLA requires the following details:
|
|
37
39
|
* middle_name (optional)
|
38
40
|
* ssn (required)
|
39
41
|
* dob (required)
|
40
|
-
* tracking_number that will be embedded in the Certificate (optional)
|
41
42
|
|
42
43
|
Create an applicant object:
|
43
44
|
|
44
|
-
|
45
|
-
mla = MlaActiveDutyStatus::Applicant.new(
|
46
|
-
|
47
|
-
first_name: 'Alfred',
|
48
|
-
middle_name: 'A',
|
49
|
-
ssn: '614223456',
|
50
|
-
date_of_birth: '1950-01-25')
|
51
|
-
````
|
45
|
+
```ruby
|
46
|
+
mla = MlaActiveDutyStatus::Applicant.new('Citizen', 'John', 'Q', '614223456', '1950-01-25')
|
47
|
+
```
|
52
48
|
|
53
49
|
Check that the applicant details meet requirements:
|
54
50
|
|
55
|
-
|
51
|
+
```ruby
|
56
52
|
mla.valid?
|
57
53
|
````
|
58
54
|
This returns `true` or `false` and then you can view any validation errors:
|
59
55
|
|
60
|
-
|
56
|
+
```
|
61
57
|
mla.errors
|
62
58
|
=> ["last_name must be present", "date_of_birth must be within 100 years"]
|
63
|
-
|
59
|
+
```
|
64
60
|
|
65
61
|
Get the active duty status of the applicant:
|
66
62
|
|
67
|
-
|
63
|
+
```ruby
|
68
64
|
mla.active_duty_status
|
69
|
-
|
65
|
+
```
|
70
66
|
|
71
67
|
This returns an array of 2 values:
|
72
68
|
* status:
|
@@ -100,18 +96,18 @@ The MLA site is part of the DoD and uses site certificates that you might not or
|
|
100
96
|
The MLA has [instructions for installing certificates](https://mla.dmdc.osd.mil/faq.xhtml#Q1),
|
101
97
|
but you will most likely need to download the cert file to your production server and point to it like this:
|
102
98
|
|
103
|
-
|
99
|
+
```ruby
|
104
100
|
MlaActiveDutyStatus.configuration.ca_path = '/path/to/my/ca_cert.crt'
|
105
|
-
|
101
|
+
```
|
106
102
|
|
107
103
|
By default, this gem will use this certificates path: `"#{ENV['JAVA_HOME']}/jre/lib/security/cacerts"`
|
108
104
|
|
109
105
|
It is highly recommended that you do NOT disable certificate verification, but if you need to debug a problem
|
110
106
|
then set the configuration like this:
|
111
107
|
|
112
|
-
|
108
|
+
```ruby
|
113
109
|
MlaActiveDutyStatus.configuration.ssl_verify = false
|
114
|
-
|
110
|
+
```
|
115
111
|
|
116
112
|
## Contributing
|
117
113
|
|
@@ -9,14 +9,13 @@ module MlaActiveDutyStatus
|
|
9
9
|
|
10
10
|
attr_reader :last_name, :first_name, :middle_name, :ssn, :date_of_birth, :date_of_birth_usa
|
11
11
|
|
12
|
-
def initialize(last_name, first_name, middle_name, ssn, date_of_birth
|
12
|
+
def initialize(last_name, first_name, middle_name, ssn, date_of_birth)
|
13
13
|
@last_name = last_name.to_s.strip
|
14
14
|
@first_name = first_name.to_s.strip
|
15
15
|
@middle_name = middle_name.to_s.strip
|
16
16
|
@ssn = ssn.to_s.strip.gsub(/\D/, '')
|
17
17
|
@date_of_birth = date_of_birth
|
18
18
|
@date_of_birth_usa = nil
|
19
|
-
@tracking_number = tracking_number
|
20
19
|
@errors = []
|
21
20
|
end
|
22
21
|
|
@@ -38,7 +37,7 @@ module MlaActiveDutyStatus
|
|
38
37
|
end
|
39
38
|
|
40
39
|
def file_format
|
41
|
-
sprintf('%9s', @ssn) + @date_of_birth.strftime('%Y%m%d') + sprintf('%-26.26s', @last_name) + sprintf('%-20.20s', @first_name) + sprintf('%-20.20s', @middle_name) + sprintf('%-28.28s',
|
40
|
+
sprintf('%9s', @ssn) + @date_of_birth.strftime('%Y%m%d') + sprintf('%-26.26s', @last_name) + sprintf('%-20.20s', @first_name) + sprintf('%-20.20s', @middle_name) + sprintf('%-28.28s', '')
|
42
41
|
end
|
43
42
|
|
44
43
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mla_active_duty_status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jimjames99
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|