experian-data-dictionary 1.3 → 1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31acf5f264b4c414f99a369ccaa468d1232270f9
4
- data.tar.gz: 137ea1e4706346c27e2bd6bb16d55cbd4b1d4075
3
+ metadata.gz: 2be9a761b138c70353c802fefbe69bc5697904d6
4
+ data.tar.gz: 4c4093b5a4d77c6984fd34291d5ed8eef272bac9
5
5
  SHA512:
6
- metadata.gz: 8e814caac3c262f7d1778c8989bfba56df8a02e30c5d0f983bac9d4d133db1f7a3142e5745d65d792c89198237bee402eea591fd88f9ae319f6834f1a75a1875
7
- data.tar.gz: 191fa5720e6c8b7f7e84c32ebdb78489c65d3e7f0f6a455de2df6f7a212348a71ef2d1964cd159b277ccab6dc0b3424b63189b59b024efefb70aee626e249bbc
6
+ metadata.gz: 7993418f604b6872b06df2a968cd4e9104acdd2ab6fbf421b5799ab49083e5c11f6583faba8fa5beace7cb5a879bdba7fad72739b6012220c2080acb2c0a89eb
7
+ data.tar.gz: 62c448f2f2f331aabfd99af320358494db4db732c889e0dc365f829b6580a1131d8760df62765c1b736206d8f19615242581ab5ff5a7459e97afbcb2f20a4188
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  PROJECT_GEM = 'experian-data-dictionary'
3
- PROJECT_GEM_VERSION = '1.3'
3
+ PROJECT_GEM_VERSION = '1.4'
4
4
 
5
5
  s.name = PROJECT_GEM
6
6
  s.version = PROJECT_GEM_VERSION
@@ -8,7 +8,7 @@ module Experian
8
8
  def self.en_0100_description
9
9
  'Date of Birth is acquired from public and proprietary files. These sources provide, at a minimum, the year of birth. The birth month is provided where available. Estimated ages are acquired from proprietary data sources and Experian models which estimate the adult age.'
10
10
  end
11
-
11
+
12
12
  def self.en_0100c_column_name
13
13
  'Combined Adult Age'
14
14
  end
@@ -27,14 +27,18 @@ module Experian
27
27
 
28
28
 
29
29
  def self.en_0100c(key)
30
- return nil unless %w(e i u).include?(key[0].downcase) # I noticed another 0100c column that uses M and F which is probably for Male and Female
31
- text = case key[0].downcase
32
- when 'e' then 'Exact age'
33
- when 'i' then 'Estimated age'
34
- when 'u' then 'Unknown age'
35
- else nil
30
+ if key[0].nil?
31
+ return 'Unknown age'
32
+ else
33
+ return nil unless %w(e i u).include?(key[0].downcase) # I noticed another 0100c column that uses M and F which is probably for Male and Female
34
+ text = case key[0].downcase
35
+ when 'e' then 'Exact age'
36
+ when 'i' then 'Estimated age'
37
+ when 'u' then 'Unknown age'
38
+ else nil
39
+ end
40
+ return [key[1..key.length-1], text].compact.join(' - ')
36
41
  end
37
- return [key[1..key.length-1], text].compact.join(' - ')
38
42
  end
39
43
 
40
44
  end
@@ -11,7 +11,7 @@ module Experian
11
11
  end
12
12
 
13
13
  # Buys By TV & Buys By TV Propensity, Quick Predict Code
14
- def self.en_8532_column_name
14
+ def self.en_8532p_column_name
15
15
  'Buys By TV & Buys By TV Propensity, Quick Predict Code'
16
16
  end
17
17
 
@@ -2,15 +2,15 @@ module Experian
2
2
  class DataDictionary
3
3
 
4
4
  # Discretionary Spend Estimate
5
- def self.en_t200_column_name
5
+ def self.en_t2000_column_name
6
6
  'Discretionary Spend Estimate'
7
7
  end
8
8
 
9
- def self.en_t200_description
9
+ def self.en_t2000_description
10
10
  'Discretionary Spend Estimate predicts the dollar estimate of annual spend on non-essential, discretionary expenses such as household furniture, alcohol and tobacco, donations, dining out, education, reading, personal care and entertainment (fees, audio/visual equipment, toys, hobbies, pets, playground equipment and other equipment). Represents an actual dollar amount.'
11
11
  end
12
12
 
13
- def self.en_t200(key)
13
+ def self.en_t2000(key)
14
14
  values = {
15
15
  '4' => 'Zip+4 level data',
16
16
  'L' => 'Living unit level data',
data/lib/experian.rb CHANGED
@@ -7,7 +7,8 @@ module Experian
7
7
 
8
8
  def self.lookup(column, key)
9
9
  column = column.to_s.downcase.gsub(/\s+/, '')
10
- self.send("en_#{column}", key.to_s.strip)
10
+ key = key.to_s.strip
11
+ self.send("en_#{column}", key)
11
12
  end
12
13
 
13
14
  def self.column_name(column)
@@ -23,6 +23,7 @@ describe 'Experian::DataDictionary 0100c' do
23
23
  it { expect( Experian::DataDictionary.lookup('0100c','e99') ).to eq('99 - Exact age') }
24
24
  it { expect( Experian::DataDictionary.lookup('0100c','i50') ).to eq('50 - Estimated age') }
25
25
  it { expect( Experian::DataDictionary.lookup('0100c','u') ).to eq(' - Unknown age') }
26
+ it { expect( Experian::DataDictionary.lookup('0100c','') ).to eq('Unknown age') }
26
27
 
27
28
  end
28
29
 
@@ -0,0 +1,23 @@
1
+ require File.join(Dir.pwd, 'spec', 'spec_helper')
2
+
3
+ describe 'Experian::DataDictionary t2000' do
4
+
5
+ context 'valid lookup' do
6
+ it { expect( Experian::DataDictionary.lookup('t2000',' ') ).to eq('Unknown') }
7
+ it { expect( Experian::DataDictionary.lookup('t2000','400888') ).to eq('Zip+4 level data - 00888') }
8
+ it { expect( Experian::DataDictionary.lookup('t2000','L87900') ).to eq('Living unit level data - 87900') }
9
+ it { expect( Experian::DataDictionary.lookup('t2000','Z12333') ).to eq('Zip level data - 12333') }
10
+ it { expect( Experian::DataDictionary.lookup('t2000','Z') ).to eq('Unknown') }
11
+
12
+
13
+ end
14
+
15
+
16
+ context 'invalid lookup' do
17
+ it { expect( Experian::DataDictionary.lookup('t2000','F') ).to eq('Unknown') }
18
+ it { expect( Experian::DataDictionary.lookup('t2000','PE') ).to eq('Unknown') }
19
+ it { expect( Experian::DataDictionary.lookup('t2000','GG') ).to eq('Unknown') }
20
+ it { expect( Experian::DataDictionary.lookup('t2000','DOG') ).to eq('Unknown') }
21
+ end
22
+
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: experian-data-dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Campbell
@@ -21,7 +21,6 @@ files:
21
21
  - ".gitignore"
22
22
  - ".pryrc"
23
23
  - ".rspec"
24
- - ".ruby-gemset"
25
24
  - Gemfile
26
25
  - Gemfile.lock
27
26
  - README.rdoc
@@ -92,14 +91,13 @@ files:
92
91
  - lib/element_numbers/en_G2601.rb
93
92
  - lib/element_numbers/en_G2602.rb
94
93
  - lib/element_numbers/en_G2603.rb
95
- - lib/element_numbers/en_GE06.rb
96
94
  - lib/element_numbers/en_GEO6.rb
97
95
  - lib/element_numbers/en_L000.rb
98
96
  - lib/element_numbers/en_P213E.rb
99
97
  - lib/element_numbers/en_P213H.rb
100
98
  - lib/element_numbers/en_P213W.rb
101
99
  - lib/element_numbers/en_P400.rb
102
- - lib/element_numbers/en_T200.rb
100
+ - lib/element_numbers/en_T2000.rb
103
101
  - lib/element_numbers/en_V000.rb
104
102
  - lib/element_numbers/en_Y000.rb
105
103
  - lib/experian.rb
@@ -163,7 +161,7 @@ files:
163
161
  - spec/functional/en_P213H_spec.rb
164
162
  - spec/functional/en_P213W_spec.rb
165
163
  - spec/functional/en_P400_spec.rb
166
- - spec/functional/en_T200_spec.rb
164
+ - spec/functional/en_T2000_spec.rb
167
165
  - spec/functional/en_V000_spec.rb
168
166
  - spec/functional/en_Y000_spec.rb
169
167
  - spec/functional/experian_spec.rb
@@ -252,7 +250,7 @@ test_files:
252
250
  - spec/functional/en_P213H_spec.rb
253
251
  - spec/functional/en_P213W_spec.rb
254
252
  - spec/functional/en_P400_spec.rb
255
- - spec/functional/en_T200_spec.rb
253
+ - spec/functional/en_T2000_spec.rb
256
254
  - spec/functional/en_V000_spec.rb
257
255
  - spec/functional/en_Y000_spec.rb
258
256
  - spec/functional/experian_spec.rb
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- experian-gem
@@ -1,32 +0,0 @@
1
- module Experian
2
- class DataDictionary
3
-
4
- # 2010 Geo Code
5
- def self.en_geo6_column_name
6
- '2010 Geo Code'
7
- end
8
-
9
- def self.en_geo6_description
10
- 'Geo Codes are numeric symbols assigned for the identification of geographic entities such as state, county, tract, block, groups, etc., by the U.S. Census Bureau. Every geographic
11
- entity recognized by the Census Bureau is assigned one or more geographic codes. A geo code is geographic presentation that shows the geographic entities in a
12
- superior/subordinate structure. In this system of relationships among geographic entities, each entity (except the smallest one) is subdivided into lower-order units that in turn may be
13
- subdivided further. For example, states are subdivided into counties, which are subdivided into both county subdivisions and census tracts.
14
- State Code (2 position) States and equivalent areas. Besides the 50 states, the Census Bureau treats the District of Columbia, Puerto Rico, and the Island areas (the U.S. Virgin
15
- Islands, Guam, American Samoa, and the Northern Mariana Islands) as state equivalents for statistical presentation.
16
- County Code (3 positions) Counties and equivalent areas. These are the primary divisions of most states, Puerto Rico, and the Island Areas. They include counties in 48 states;
17
- parishes in Louisiana; boroughs and census areas in Alaska; municipios in Puerto Rico; independent cities in Maryland, Missouri, Nevada, and Virginia; and other entities in the
18
- Island Areas.
19
- Census Tract Code (6 positions) These small statistical subdivisions (averaging about 4,000 persons) of counties generally have stable boundaries and, when first established, were
20
- designed to have relatively homogeneous demographic characteristics.
21
- Census Block Group (1 position) Block groups are a collection of census blocks within a census tract, sharing the same first digit of their four-digit identifying numbers.
22
- Census Block ID (3 positions) Block ID within a block group
23
- CBSA (5 positions) A statistically based geographic level consisting of county or counties associated with at least one area of at least 10,000 population. Source: US Office of
24
- Management and Budget (OMB)'
25
- end
26
-
27
- def self.en_geo6(key)
28
- key.empty? ? 'Unknown' : key.to_i
29
- end
30
-
31
- end
32
- end
@@ -1,23 +0,0 @@
1
- require File.join(Dir.pwd, 'spec', 'spec_helper')
2
-
3
- describe 'Experian::DataDictionary t200' do
4
-
5
- context 'valid lookup' do
6
- it { expect( Experian::DataDictionary.lookup('t200',' ') ).to eq('Unknown') }
7
- it { expect( Experian::DataDictionary.lookup('t200','400888') ).to eq('Zip+4 level data - 00888') }
8
- it { expect( Experian::DataDictionary.lookup('t200','L87900') ).to eq('Living unit level data - 87900') }
9
- it { expect( Experian::DataDictionary.lookup('t200','Z12333') ).to eq('Zip level data - 12333') }
10
- it { expect( Experian::DataDictionary.lookup('t200','Z') ).to eq('Unknown') }
11
-
12
-
13
- end
14
-
15
-
16
- context 'invalid lookup' do
17
- it { expect( Experian::DataDictionary.lookup('t200','F') ).to eq('Unknown') }
18
- it { expect( Experian::DataDictionary.lookup('t200','PE') ).to eq('Unknown') }
19
- it { expect( Experian::DataDictionary.lookup('t200','GG') ).to eq('Unknown') }
20
- it { expect( Experian::DataDictionary.lookup('t200','DOG') ).to eq('Unknown') }
21
- end
22
-
23
- end