Sha256: f43b4cfd58b92b6640adc10c34c308c20a43daed75c11cc7c891e420f17378b0

Contents?: true

Size: 1.05 KB

Versions: 18

Compression:

Stored size: 1.05 KB

Contents

require_relative 'components'
require_relative 'metadata'
require_relative 'analysis'

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,
                  :last_line,:delivery_point_barcode, :smarty_key, :metadata, :components, :analysis

      def initialize(obj)
        @input_id = obj['input_id']
        @input_index = obj['input_index']
        @candidate_index = obj['candidate_index']
        @addressee = obj['addressee']
        @delivery_line_1 = obj['delivery_line_1']
        @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', {}))
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
smartystreets_ruby_sdk-5.20.6 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.20.4 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.20.3 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.20.2 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.19.0 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.18.1 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.18.0 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.17.2 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.17.1 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.17.0 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.16.2 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.16.1 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.16.0 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.15.4 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.15.3 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.15.2 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.15.1 lib/smartystreets_ruby_sdk/us_street/candidate.rb
smartystreets_ruby_sdk-5.15.0 lib/smartystreets_ruby_sdk/us_street/candidate.rb