Class: AtlasEngine::AddressImporter::Corrections::Corrector

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
app/models/atlas_engine/address_importer/corrections/corrector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(country_code:, source:) ⇒ Corrector

Returns a new instance of Corrector.



12
13
14
15
# File 'app/models/atlas_engine/address_importer/corrections/corrector.rb', line 12

def initialize(country_code:, source:)
  @country_code = country_code.upcase
  @correctors ||= correctors_for_country(@country_code, source)
end

Instance Attribute Details

#correctorsObject (readonly)

Returns the value of attribute correctors.



9
10
11
# File 'app/models/atlas_engine/address_importer/corrections/corrector.rb', line 9

def correctors
  @correctors
end

Instance Method Details

#apply(address) ⇒ Object



18
19
20
21
22
# File 'app/models/atlas_engine/address_importer/corrections/corrector.rb', line 18

def apply(address)
  correctors.each do |corrector|
    corrector.apply(address)
  end
end