Class: AtlasEngine::AddressImporter::Corrections::Corrector
- Inherits:
-
Object
- Object
- AtlasEngine::AddressImporter::Corrections::Corrector
- Extended by:
- T::Sig
- Defined in:
- app/models/atlas_engine/address_importer/corrections/corrector.rb
Instance Attribute Summary collapse
-
#correctors ⇒ Object
readonly
Returns the value of attribute correctors.
Instance Method Summary collapse
- #apply(address) ⇒ Object
-
#initialize(country_code:, source:) ⇒ Corrector
constructor
A new instance of Corrector.
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
#correctors ⇒ Object (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 |