Sha256: 73ae76f3c76bc6defac77ba75984e7d6712535dc442d058b2146190b24a28b7f

Contents?: true

Size: 912 Bytes

Versions: 6

Compression:

Stored size: 912 Bytes

Contents

module SmartyStreets
  module InternationalAutocomplete
    class Suggestion

      attr_reader :street, :locality, :administrative_area, :administrative_area_short, :administrative_area_long, :postal_code, :country_iso3, :entries, :address_text, :address_id

      def initialize(obj)
        @street = obj.fetch('street', nil)
        @locality = obj.fetch('locality', nil)
        @administrative_area = obj.fetch('administrative_area', nil)
        @administrative_area_short = obj.fetch('administrative_area_short', nil)
        @administrative_area_long = obj.fetch('administrative_area_long', nil)
        @postal_code = obj.fetch('postal_code', nil)
        @country_iso3 = obj.fetch('country_iso3', nil)
        # v2 fields
        @entries = obj.fetch('entries', nil)
        @address_text = obj.fetch('address_text', nil)
        @address_id = obj.fetch('address_id', nil)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
smartystreets_ruby_sdk-5.20.6 lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
smartystreets_ruby_sdk-5.20.4 lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
smartystreets_ruby_sdk-5.20.3 lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
smartystreets_ruby_sdk-5.20.2 lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
smartystreets_ruby_sdk-5.19.0 lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
smartystreets_ruby_sdk-5.18.1 lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb