Skip to content

Commit

Permalink
Merge branch 'smarty-key'
Browse files Browse the repository at this point in the history
  • Loading branch information
savannah-ryan committed Jul 6, 2023
2 parents 2cbb3e6 + eb7b0c2 commit 98431db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/smartystreets_ruby_sdk/us_street/candidate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module SmartyStreets
module USStreet
# See "https://smartystreets.com/docs/cloud/us-street-api#metadata"
class Candidate
attr_reader :input_id, :input_index, :candidate_index, :addressee, :delivery_line_1, :delivery_line_2, :delivery_point_barcode,
:last_line, :metadata, :components, :analysis
attr_reader :input_id, :input_index, :candidate_index, :addressee, :delivery_line_1, :delivery_line_2,
:last_line,:delivery_point_barcode, :smarty_key, :metadata, :components, :analysis

def initialize(obj)
@input_id = obj['input_id']
Expand All @@ -18,6 +18,7 @@ def initialize(obj)
@delivery_line_2 = obj['delivery_line_2']
@last_line = obj['last_line']
@delivery_point_barcode = obj['delivery_point_barcode']
@smarty_key = obj['smarty_key']
@components = Components.new(obj.fetch('components', {}))
@metadata = Metadata.new(obj.fetch('metadata', {}))
@analysis = Analysis.new(obj.fetch('analysis', {}))
Expand Down
2 changes: 2 additions & 0 deletions test/smartystreets_ruby_sdk/us_street/test_candidate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_all_fields_filled_correctly
'delivery_line_2' => '4',
'last_line' => '5',
'delivery_point_barcode' => '6',
'smarty_key' => '112',
'components' => {
'urbanization' => '7',
'primary_number' => '8',
Expand Down Expand Up @@ -81,6 +82,7 @@ def test_all_fields_filled_correctly
assert_equal('4', candidate.delivery_line_2)
assert_equal('5', candidate.last_line)
assert_equal('6', candidate.delivery_point_barcode)
assert_equal('112', candidate.smarty_key)

assert_equal('7', candidate.components.urbanization)
assert_equal('8', candidate.components.primary_number)
Expand Down

0 comments on commit 98431db

Please sign in to comment.