Class: AtlasEngine::AddressValidation::Validators::Predicates::NotExceedMaxTokenCount
- Inherits:
-
Predicate
- Object
- Predicate
- AtlasEngine::AddressValidation::Validators::Predicates::NotExceedMaxTokenCount
- Defined in:
- app/models/atlas_engine/address_validation/validators/predicates/not_exceed_max_token_count.rb
Constant Summary collapse
- MAX_TOKEN_COUNT =
15
Instance Attribute Summary
Attributes inherited from Predicate
#address, #cache, #field, #message_format
Instance Method Summary collapse
Methods inherited from Predicate
Constructor Details
This class inherits a constructor from AtlasEngine::AddressValidation::Validators::Predicates::Predicate
Instance Method Details
#evaluate ⇒ Object
12 13 14 15 |
# File 'app/models/atlas_engine/address_validation/validators/predicates/not_exceed_max_token_count.rb', line 12 def evaluate tokens = extract_address_tokens_from(address.send(@field)) build_concern if tokens.present? && tokens.count >= MAX_TOKEN_COUNT end |