class Dropmire::Validator

Public Class Methods

new(text) click to toggle source
# File lib/dropmire/validator.rb, line 5
def initialize(text)
  @text = text
  validate
end

Public Instance Methods

regex() click to toggle source
# File lib/dropmire/validator.rb, line 16
def regex
  /%[\w\s]*\^[\w\s]*\$[\w\s]*\$[\w\s]*\^[\w\s]*\^\s*\?;\d*=\d*=\?\+\!\s*\d*[\s\w]*\?/
end
validate() click to toggle source
# File lib/dropmire/validator.rb, line 10
def validate
  if regex.match(@text).to_s == ""
    raise ParseError.new("Malformed input string", @text)
  end
end