Class: NumberPlateValidator::CountryValidatorBase

Inherits:
Object
  • Object
show all
Defined in:
lib/number_plate_validator/country_validator_base.rb

Direct Known Subclasses

MYValidator, SGValidator

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



4
5
6
# File 'lib/number_plate_validator/country_validator_base.rb', line 4

def country
  @country
end

Instance Method Details

#is_valid?(registration_number) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/number_plate_validator/country_validator_base.rb', line 6

def is_valid?(registration_number)
	@license = registration_number.gsub(/\s/, "").upcase if registration_number.present?
	@license.present?
end