diff --git a/lib/smartystreets_ruby_sdk/us_street/client.rb b/lib/smartystreets_ruby_sdk/us_street/client.rb index c8eed99..40e58ed 100644 --- a/lib/smartystreets_ruby_sdk/us_street/client.rb +++ b/lib/smartystreets_ruby_sdk/us_street/client.rb @@ -61,7 +61,7 @@ def remap_keys(obj) converted_lookup['urbanization'] = lookup.urbanization converted_lookup['match'] = lookup.match converted_lookup['candidates'] = lookup.candidates - + converted_lookup['format'] = lookup.format converted_obj.push(converted_lookup) end converted_obj diff --git a/lib/smartystreets_ruby_sdk/us_street/lookup.rb b/lib/smartystreets_ruby_sdk/us_street/lookup.rb index ba5984d..0b3d48b 100644 --- a/lib/smartystreets_ruby_sdk/us_street/lookup.rb +++ b/lib/smartystreets_ruby_sdk/us_street/lookup.rb @@ -9,10 +9,10 @@ module USStreet # @match:: Must be set to 'strict', 'range', or 'invalid'. Constants for these are in match_type.rb class Lookup < JSONAble attr_accessor :input_id, :street, :street2, :secondary, :city, :state, :zipcode, :lastline, :addressee, :urbanization, - :match, :candidates, :result + :match, :candidates, :format, :result def initialize(street=nil, street2=nil, secondary=nil, city=nil, state=nil, zipcode=nil, lastline=nil, - addressee=nil, urbanization=nil, match=nil, candidates=0, input_id=nil) + addressee=nil, urbanization=nil, match=nil, candidates=0, input_id=nil, format=nil) @input_id = input_id @street = street @street2 = street2 @@ -25,6 +25,7 @@ def initialize(street=nil, street2=nil, secondary=nil, city=nil, state=nil, zipc @urbanization = urbanization @match = match @candidates = candidates + @format = format @result = [] end end diff --git a/lib/smartystreets_ruby_sdk/us_street/match_type.rb b/lib/smartystreets_ruby_sdk/us_street/match_type.rb index 11a9d7f..53782f5 100644 --- a/lib/smartystreets_ruby_sdk/us_street/match_type.rb +++ b/lib/smartystreets_ruby_sdk/us_street/match_type.rb @@ -6,5 +6,11 @@ module MatchType INVALID = 'invalid'.freeze ENHANCED = 'enhanced'.freeze end + + module OutputFormat + DEFAULT = 'default'.freeze + PROJECT_USA = 'project-usa'.freeze + CASS = 'cass'.freeze + end end end diff --git a/test/smartystreets_ruby_sdk/us_street/test_street_client.rb b/test/smartystreets_ruby_sdk/us_street/test_street_client.rb index eafb47c..f5f719d 100644 --- a/test/smartystreets_ruby_sdk/us_street/test_street_client.rb +++ b/test/smartystreets_ruby_sdk/us_street/test_street_client.rb @@ -38,7 +38,8 @@ def test_send_populated_lookup 'addressee' => '9', 'urbanization' => '10', 'match' => SmartyStreets::USStreet::MatchType::ENHANCED, - 'candidates' => 5 + 'candidates' => 5, + 'format' => SmartyStreets::USStreet::OutputFormat::PROJECT_USA, } serializer = FakeSerializer.new(expected_parameters) client = Client.new(sender, serializer) @@ -54,7 +55,7 @@ def test_send_populated_lookup lookup.addressee = '9' lookup.urbanization = '10' lookup.match = SmartyStreets::USStreet::MatchType::ENHANCED - + lookup.format = SmartyStreets::USStreet::OutputFormat::PROJECT_USA client.send_lookup(lookup) assert_equal(expected_parameters, sender.request.parameters)