Sha256: 2324cec2f96cef411a5c29f445424c7b433fa2a305c6c5f6582d2d86230c6fbe

Contents?: true

Size: 472 Bytes

Versions: 1

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

module SolidusZipZones
  module TaxLocationDecorator
    def self.prepended(base)
      base.send(:attr_reader, :zipcode)
    end

    def initialize(country: nil, state: nil, zipcode: nil)
      super(country: country, state: state)

      @zipcode = zipcode
    end

    def ==(other)
      super && zipcode == other.zipcode
    end

    def empty?
      super && zipcode.blank?
    end

    Spree::Tax::TaxLocation.prepend self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_zip_zones-0.1.0 app/models/solidus_zip_zones/tax_location_decorator.rb