Class: AtlasEngine::Kr::AddressValidation::Validators::FullAddress::Exclusions::City

Inherits:
AddressValidation::Validators::FullAddress::Exclusions::ExclusionBase show all
Extended by:
T::Sig
Defined in:
app/countries/atlas_engine/kr/address_validation/validators/full_address/exclusions/city.rb

Constant Summary collapse

COMPONENT_IDENTIFIER =
{
  si: "",
  gu: "",
}.freeze

Class Method Summary collapse

Class Method Details

.apply?(candidate, address_comparison) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'app/countries/atlas_engine/kr/address_validation/validators/full_address/exclusions/city.rb', line 26

def apply?(candidate, address_comparison)
  candidate_si = extract_component_from_city(candidate, :si)
  candidate_gu = extract_component_from_city(candidate, :gu)

  (candidate_si.present? && contains_component?(:si, candidate_si, address_comparison)) ||
    (candidate_gu.present? && contains_component?(:gu, candidate_gu, address_comparison))
end