Class: ValidateZipcode::Validator
- Inherits:
-
Object
- Object
- ValidateZipcode::Validator
- Defined in:
- lib/validate_zipcode/validator.rb
Instance Method Summary collapse
-
#initialize(zipcode, locale) ⇒ Validator
constructor
A new instance of Validator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(zipcode, locale) ⇒ Validator
Returns a new instance of Validator.
3 4 5 6 |
# File 'lib/validate_zipcode/validator.rb', line 3 def initialize(zipcode, locale) @zipcode = zipcode variables(locale) unless @zipcode.blank? end |
Instance Method Details
#valid? ⇒ Boolean
8 9 10 11 |
# File 'lib/validate_zipcode/validator.rb', line 8 def valid? return true if @zipcode.blank? @match end |