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.4.27 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.4 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.26 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.3 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.25 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.2 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.24 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.1 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.23 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.22 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.0 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.21 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.5.0.beta.1 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.20 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.19 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.18 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.17 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.16 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.15 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.14 vendor/active_shipping/lib/active_shipping/address_validation_response.rb