metro_2 1.0.0 → 1.0.1
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 +20 -2
- data/lib/metro_2/fields.rb +6 -1
- data/lib/metro_2/metro2_file.rb +22 -22
- data/lib/metro_2/records/header_segment.rb +1 -1
- data/lib/metro_2/version.rb +1 -1
- data/spec/records/header_segment_spec.rb +0 -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: 145a8a4f116a665a554943048638b61298ce0695
|
4
|
+
data.tar.gz: e15c6b31ed588ec864ae6bd2aca03991d44a711b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c18b32672113c3b644466a958a6442830dedae0f0106fc00f281adf8a32653254a1d21d4d46a53622ae9c0cb96ba6d6f73f115e48042a21e187eb510f65017
|
7
|
+
data.tar.gz: 32d1da16feeacb3493ba9ecf08e667a6450f1e4b0ed9e8704ce2bf1bb96f376dafcbbf6a4da1973af32810c62bef5908a25e7ddd3a3e2b6c95cafcb2e3fab8c7
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Metro2
|
2
2
|
|
3
|
-
|
3
|
+
Creates files in Metro 2 format for reporting to credit agencies
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,25 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
```ruby
|
24
|
+
metro_2_content = Metro2::Metro2File.new
|
25
|
+
metro_2_content.header.cycle_number = 15
|
26
|
+
metro_2_content.header.equifax_program_identifier = 'EFAXID'
|
27
|
+
metro_2_content.header.transunion_program_identifier = 'TRANSUNION'
|
28
|
+
# ... other header segment attributes
|
29
|
+
|
30
|
+
base_segment = Metro2::Records::BaseSegment.new
|
31
|
+
base_segment.time_stamp = Time.new(2014, 9, 15, 17, 7, 45)
|
32
|
+
base_segment.identification_number = 'REPORTERXYZ'
|
33
|
+
base_segment.cycle_number = 1
|
34
|
+
base_segment.consumer_account_number = 'ABC123'
|
35
|
+
base_segment.portfolio_type = 'I'
|
36
|
+
# ... other base segment attributes
|
37
|
+
metro_2_content.base_segments << base_segment
|
38
|
+
# add more base segments as needed
|
39
|
+
|
40
|
+
metro_2_content.to_s # contents to write to file
|
41
|
+
```
|
24
42
|
|
25
43
|
## Contributing
|
26
44
|
|
data/lib/metro_2/fields.rb
CHANGED
@@ -91,7 +91,12 @@ module Metro2
|
|
91
91
|
define_method "#{name}_to_metro2" do
|
92
92
|
# Right justified and zero-filled
|
93
93
|
val = instance_variable_get("@#{name}")
|
94
|
-
|
94
|
+
if val
|
95
|
+
val = val.strftime('%m%d%Y')
|
96
|
+
elsif name == :program_revision_date || name == :last_payment_date
|
97
|
+
val = '01'
|
98
|
+
end
|
99
|
+
|
95
100
|
Metro2.numeric_to_metro2(val, 8, false)
|
96
101
|
end
|
97
102
|
end
|
data/lib/metro_2/metro2_file.rb
CHANGED
@@ -41,28 +41,28 @@ module Metro2
|
|
41
41
|
trailer = Records::TrailerSegment.new
|
42
42
|
trailer.total_base_records = @base_segments.size
|
43
43
|
trailer.total_status_code_df = status_code_count['DF']
|
44
|
-
trailer.
|
45
|
-
trailer.
|
46
|
-
trailer.
|
47
|
-
trailer.
|
48
|
-
trailer.
|
49
|
-
trailer.
|
50
|
-
trailer.
|
51
|
-
trailer.
|
52
|
-
trailer.
|
53
|
-
trailer.
|
54
|
-
trailer.
|
55
|
-
trailer.
|
56
|
-
trailer.
|
57
|
-
trailer.
|
58
|
-
trailer.
|
59
|
-
trailer.
|
60
|
-
trailer.
|
61
|
-
trailer.
|
62
|
-
trailer.
|
63
|
-
trailer.
|
64
|
-
trailer.
|
65
|
-
trailer.
|
44
|
+
trailer.total_status_code_da = status_code_count['DA']
|
45
|
+
trailer.total_status_code_05 = status_code_count['05']
|
46
|
+
trailer.total_status_code_11 = status_code_count['11']
|
47
|
+
trailer.total_status_code_13 = status_code_count['13']
|
48
|
+
trailer.total_status_code_61 = status_code_count['61']
|
49
|
+
trailer.total_status_code_62 = status_code_count['62']
|
50
|
+
trailer.total_status_code_63 = status_code_count['63']
|
51
|
+
trailer.total_status_code_64 = status_code_count['64']
|
52
|
+
trailer.total_status_code_65 = status_code_count['65']
|
53
|
+
trailer.total_status_code_71 = status_code_count['71']
|
54
|
+
trailer.total_status_code_78 = status_code_count['78']
|
55
|
+
trailer.total_status_code_80 = status_code_count['80']
|
56
|
+
trailer.total_status_code_82 = status_code_count['82']
|
57
|
+
trailer.total_status_code_83 = status_code_count['83']
|
58
|
+
trailer.total_status_code_84 = status_code_count['84']
|
59
|
+
trailer.total_status_code_88 = status_code_count['88']
|
60
|
+
trailer.total_status_code_89 = status_code_count['89']
|
61
|
+
trailer.total_status_code_93 = status_code_count['93']
|
62
|
+
trailer.total_status_code_94 = status_code_count['94']
|
63
|
+
trailer.total_status_code_94 = status_code_count['95']
|
64
|
+
trailer.total_status_code_96 = status_code_count['96']
|
65
|
+
trailer.total_status_code_97 = status_code_count['97']
|
66
66
|
trailer.ecoa_code_z = num_ecoa_code_z
|
67
67
|
trailer.total_social_security_numbers = num_ssn
|
68
68
|
trailer.total_social_security_numbers_in_base = num_ssn
|
@@ -12,7 +12,7 @@ module Metro2::Records
|
|
12
12
|
date_field :activity_date
|
13
13
|
date_field :created_date
|
14
14
|
date_field :program_date
|
15
|
-
|
15
|
+
date_field :program_revision_date
|
16
16
|
alphanumeric_field :reporter_name, 40
|
17
17
|
alphanumeric_field :reporter_address, 96, Metro2::ALPHANUMERIC_PLUS_DOT_DASH_SLASH
|
18
18
|
numeric_field :reporter_telephone_number, 10
|
data/lib/metro_2/version.rb
CHANGED
@@ -9,7 +9,6 @@ describe Metro2::Records::HeaderSegment do
|
|
9
9
|
@header.activity_date = Date.new(2014,9,14)
|
10
10
|
@header.created_date = Date.new(2014,9,15)
|
11
11
|
@header.program_date = Date.new(2014,9,1)
|
12
|
-
@header.program_revision_date = '01'
|
13
12
|
@header.reporter_name = 'Credit Reporter'
|
14
13
|
@header.reporter_address = '123 Report Dr Address CA 91111'
|
15
14
|
@header.reporter_telephone_number = '5555555555'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metro_2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Mascarenhas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|