class Checkability::Validator

Checks if postcode comply with regex

Attributes

format[R]

Public Instance Methods

post_initialize(conf = {}) click to toggle source
# File lib/checkability/validator.rb, line 9
def post_initialize(conf = {})
  @format = conf[:format]
end
result(checkable) click to toggle source
# File lib/checkability/validator.rb, line 13
def result(checkable)
  !(checkable.value.delete(' ') =~ format[:regex]).nil?
end