Class: MetadataPresenter::AddressValidator
- Inherits:
-
BaseValidator
- Object
- BaseValidator
- MetadataPresenter::AddressValidator
- Defined in:
- app/validators/metadata_presenter/address_validator.rb
Constant Summary collapse
- REQUIRED_FIELDS =
%i[ address_line_one city postcode country ].freeze
- OPTIONAL_FIELDS =
%i[ address_line_two county ].freeze
Instance Attribute Summary
Attributes inherited from BaseValidator
Instance Method Summary collapse
Methods inherited from BaseValidator
#custom_error_message, #default_error_message, #error_key, #error_message_hash, #initialize, #invalid_answer?, #schema_key, #user_answer, #validation_value
Constructor Details
This class inherits a constructor from MetadataPresenter::BaseValidator
Instance Method Details
#valid? ⇒ Boolean
15 16 17 18 19 20 21 |
# File 'app/validators/metadata_presenter/address_validator.rb', line 15 def valid? return true if allow_blank? validate_required_fields user_answer.errors.empty? end |