Sha256: d3f6c93faa73a24ffd2871e7f200bba15f37bcf353932b9e85cf950e12dba978

Contents?: true

Size: 755 Bytes

Versions: 17

Compression:

Stored size: 755 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

17 entries across 17 versions & 1 rubygems

Version Path
active_shipping-2.1.1 lib/active_shipping/address_validation_response.rb
active_shipping-2.1.0 lib/active_shipping/address_validation_response.rb
active_shipping-2.0.1 lib/active_shipping/address_validation_response.rb
active_shipping-2.0.0 lib/active_shipping/address_validation_response.rb
active_shipping-1.14.2 lib/active_shipping/address_validation_response.rb
active_shipping-1.14.1 lib/active_shipping/address_validation_response.rb
active_shipping-1.14.0 lib/active_shipping/address_validation_response.rb
active_shipping-1.13.4 lib/active_shipping/address_validation_response.rb
active_shipping-1.13.3 lib/active_shipping/address_validation_response.rb
active_shipping-1.13.2 lib/active_shipping/address_validation_response.rb
active_shipping-1.13.1 lib/active_shipping/address_validation_response.rb
active_shipping-1.13.0 lib/active_shipping/address_validation_response.rb
active_shipping-1.12.1 lib/active_shipping/address_validation_response.rb
active_shipping-1.12.0 lib/active_shipping/address_validation_response.rb
active_shipping-1.11.1 lib/active_shipping/address_validation_response.rb
active_shipping-1.11.0 lib/active_shipping/address_validation_response.rb
active_shipping-1.10.1 lib/active_shipping/address_validation_response.rb