Sha256: 248d5119b33aec4426bcc5c33b9268b4aa4f8121ad094a96da327edef58acdff

Contents?: true

Size: 753 Bytes

Versions: 62

Compression:

Stored size: 753 Bytes

Contents

module ActiveShipping
  # Response object class for calls to {ActiveShipping::Carrier#validate_address}.
  #
  # @!attribute location
  #   The Location to be validated
  #   @return [String]
  class AddressValidationResponse < Response
    attr_reader :validity, :classification, :candidate_addresses, :options, :params

    def initialize(success, message, params = {}, options = {})
      @validity = options[:validity]
      @candidate_addresses = options[:candidate_addresses]
      @classification = options[:classification]
      super
    end

    def address_match?
      @validity == :valid
    end

    def residential?
      @classification == :residential
    end

    def commercial?
      @classification == :commercial
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.26 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.45 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.25 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.23 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.44 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.22 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.43 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.21 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.42 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.20 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.41 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.19 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.40 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.18 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.39 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.17 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.38 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.16 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.37 vendor/active_shipping/lib/active_shipping/address_validation_response.rb