Sha256: 899434721b44a6593200ad6a9980ab7b890e975dbc6a982d18ec5cde5c078938

Contents?: true

Size: 643 Bytes

Versions: 72

Compression:

Stored size: 643 Bytes

Contents

require_relative '../us_street/candidate'

module SmartyStreets
  module USExtract
    # See "https://smartystreets.com/docs/cloud/us-extract-api#http-response-status"
    class Address
      attr_reader :text, :start, :verified, :end, :line, :candidates

      def initialize(obj)
        @text = obj['text']
        @verified = obj['verified']
        @line = obj['line']
        @start = obj['start']
        @end = obj['end']
        candidates = obj.fetch('api_output', [])
        @candidates = []

        candidates.each {|candidate|
          @candidates.push(USStreet::Candidate.new(candidate))
        }
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
smartystreets_ruby_sdk-5.11.1 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.11.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.10.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.9.2 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.9.1 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.9.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.8.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.7.1 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.7.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.6.2 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.6.1 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.6.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.5.4 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.5.3 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.5.2 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.5.1 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.5.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.4.0 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.3.3 lib/smartystreets_ruby_sdk/us_extract/address.rb
smartystreets_ruby_sdk-5.3.2 lib/smartystreets_ruby_sdk/us_extract/address.rb