-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added GeoReference Endpoint * Removed unecessary methods * Added Secondary Endpoint * Added generic lookup * Improved generic lookup --------- Co-authored-by: Eric Devenport <eric@Eric-Devenports-MacBook-Air.local>
- Loading branch information
1 parent
1199738
commit 48dda29
Showing
17 changed files
with
327 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/attributes.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require_relative 'census_block_entry' | ||
require_relative 'census_county_division_entry' | ||
require_relative 'census_tract_entry' | ||
require_relative 'core_based_stat_area_entry' | ||
require_relative 'place_entry' | ||
|
||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class Attributes | ||
attr_reader :census_block, :census_county_division, :census_tract, :core_based_stat_area, :place | ||
|
||
def initialize(obj) | ||
@census_block = GeoReference::CensusBlockEntry.new(obj['census_block']) | ||
@census_county_division = GeoReference::CensusCountyDivisionEntry.new(obj['census_county_division']) | ||
@census_tract = GeoReference::CensusTractEntry.new(obj['census_tract']) | ||
@core_based_stat_area = GeoReference::CoreBasedStatAreaEntry.new(obj['core_based_stat_area']) | ||
@place = GeoReference::PlaceEntry.new(obj['place']) | ||
end | ||
end | ||
end | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_block_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class CensusBlockEntry | ||
attr_reader :accuracy, :geoid | ||
|
||
def initialize(obj) | ||
@accuracy = obj['accuracy'] | ||
@geoid = obj['geoid'] | ||
end | ||
end | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_county_division_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class CensusCountyDivisionEntry | ||
attr_reader :accuracy, :code, :name | ||
|
||
def initialize(obj) | ||
@accuracy = obj['accuracy'] | ||
@code = obj['code'] | ||
@name = obj['name'] | ||
end | ||
end | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/census_tract_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class CensusTractEntry | ||
attr_reader :code | ||
|
||
def initialize(obj) | ||
@code = obj['code'] | ||
end | ||
end | ||
end | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/core_based_stat_area_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class CoreBasedStatAreaEntry | ||
attr_reader :code, :name | ||
|
||
def initialize(obj) | ||
@code = obj['code'] | ||
@name = obj['name'] | ||
end | ||
end | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class Lookup | ||
attr_reader :smarty_key, :data_set, :data_sub_set | ||
|
||
def initialize(smarty_key) | ||
@smarty_key = smarty_key | ||
@data_set = 'geo-reference' | ||
@data_sub_set = nil | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/place_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class PlaceEntry | ||
attr_reader :accuracy, :code, :name, :type | ||
|
||
def initialize(obj) | ||
@accuracy = obj['accuracy'] | ||
@code = obj['code'] | ||
@name = obj['name'] | ||
@type = obj['type'] | ||
end | ||
end | ||
end | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/response.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require_relative "attributes" | ||
|
||
module SmartyStreets | ||
module USEnrichment | ||
module GeoReference | ||
class Response | ||
attr_reader :smarty_key, :data_set, :attributes | ||
|
||
def initialize(obj) | ||
@smarty_key = obj['smarty_key'] | ||
@data_set = 'geo-reference' | ||
@attributes = Attributes.new(obj['attributes']) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
class Lookup | ||
attr_reader :smarty_key, :data_set, :data_sub_set | ||
|
||
def initialize(smarty_key, data_set, data_sub_set) | ||
@smarty_key = smarty_key | ||
@data_set = data_set | ||
@data_sub_set = data_sub_set | ||
end | ||
end | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
lib/smartystreets_ruby_sdk/us_enrichment/secondary/aliases_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
class AliasesEntry | ||
attr_reader :smarty_key, :primary_number, :street_predirection, :street_name, :street_suffix, :street_postdirection, :city_name, | ||
:state_abbreviation, :zipcode, :plus4_code | ||
|
||
def initialize(obj) | ||
@smarty_key = obj['smarty_key'] | ||
@primary_number = obj['primary_number'] | ||
@street_predirection = obj['street_predirection'] | ||
@street_name = obj['street_name'] | ||
@street_suffix = obj['street_suffix'] | ||
@street_postdirection = obj['street_postdirection'] | ||
@city_name = obj['city_name'] | ||
@state_abbreviation = obj['state_abbreviation'] | ||
@zipcode = obj['zipcode'] | ||
@plus4_code = obj['plus4_code'] | ||
end | ||
end | ||
end | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
module Count | ||
class Lookup | ||
attr_reader :smarty_key, :data_set, :data_sub_set | ||
|
||
def initialize(smarty_key) | ||
@smarty_key = smarty_key | ||
@data_set = "secondary" | ||
@data_sub_set = "count" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/response.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
module Count | ||
class Response | ||
attr_reader :smarty_key, :count | ||
|
||
def initialize(obj) | ||
@smarty_key = obj['smarty_key'] | ||
@count = obj['count'] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
class Lookup | ||
attr_reader :smarty_key, :data_set, :data_sub_set | ||
|
||
def initialize(smarty_key) | ||
@smarty_key = smarty_key | ||
@data_set = "secondary" | ||
@data_sub_set = nil | ||
end | ||
end | ||
end | ||
end | ||
end |
38 changes: 38 additions & 0 deletions
38
lib/smartystreets_ruby_sdk/us_enrichment/secondary/response.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require_relative 'root_address_entry' | ||
require_relative 'aliases_entry' | ||
require_relative 'secondaries_entry' | ||
|
||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
class Response | ||
attr_reader :smarty_key, :root_address, :aliases, :secondaries | ||
|
||
def initialize(obj) | ||
@smarty_key = obj['smarty_key'] | ||
@root_address = Secondary::RootAddressEntry.new(obj['root_address']) | ||
if !obj['aliases'].nil? | ||
@aliases = createAliasesArray(obj['aliases']) | ||
end | ||
@secondaries = createSecondariesArray(obj['secondaries']) | ||
end | ||
|
||
def createAliasesArray(obj) | ||
aliasesArray = [] | ||
for item in obj do | ||
aliasesArray << Secondary::AliasesEntry.new(item) | ||
end | ||
return aliasesArray | ||
end | ||
|
||
def createSecondariesArray(obj) | ||
secondariesArray = [] | ||
for item in obj do | ||
secondariesArray << Secondary::SecondariesEntry.new(item) | ||
end | ||
return secondariesArray | ||
end | ||
end | ||
end | ||
end | ||
end |
24 changes: 24 additions & 0 deletions
24
lib/smartystreets_ruby_sdk/us_enrichment/secondary/root_address_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
class RootAddressEntry | ||
attr_reader :secondary_count, :smarty_key, :primary_number, :street_predirection, :street_name, :street_suffix, :street_postdirection, | ||
:city_name, :state_abbreviation, :zipcode, :plus4_code | ||
|
||
def initialize(obj) | ||
@secondary_count = obj['secondary_count'] | ||
@smarty_key = obj['smarty_key'] | ||
@primary_number = obj['primary_number'] | ||
@street_predirection = obj['street_predirection'] | ||
@street_name = obj['street_name'] | ||
@street_suffix = obj['street_suffix'] | ||
@street_postdirection = obj['street_postdirection'] | ||
@city_name = obj['city_name'] | ||
@state_abbreviation = obj['state_abbreviation'] | ||
@zipcode = obj['zipcode'] | ||
@plus4_code = obj['plus4_code'] | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
lib/smartystreets_ruby_sdk/us_enrichment/secondary/secondaries_entry.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module SmartyStreets | ||
module USEnrichment | ||
module Secondary | ||
class SecondariesEntry | ||
attr_reader :smarty_key, :secondary_designator, :secondary_number, :plus4_code | ||
|
||
def initialize(obj) | ||
@smarty_key = obj['smarty_key'] | ||
@secondary_designator = obj['secondary_designator'] | ||
@secondary_number = obj['secondary_number'] | ||
@plus4_code = obj['plus4_code'] | ||
end | ||
end | ||
end | ||
end | ||
end |