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.13 vendor/active_shipping/lib/active_shipping/address_validation_response.rb
workarea-core-3.4.12 vendor/active_shipping/lib/active_shipping/address_validation_response.rb