Module: SolidusZipZones::TaxLocationDecorator

Defined in:
app/models/solidus_zip_zones/tax_location_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
# File 'app/models/solidus_zip_zones/tax_location_decorator.rb', line 5

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

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'app/models/solidus_zip_zones/tax_location_decorator.rb', line 15

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

#empty?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/solidus_zip_zones/tax_location_decorator.rb', line 19

def empty?
  super && zipcode.blank?
end

#initialize(country: nil, state: nil, zipcode: nil) ⇒ Object



9
10
11
12
13
# File 'app/models/solidus_zip_zones/tax_location_decorator.rb', line 9

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

  @zipcode = zipcode
end