class EmailPredictor::Base

Attributes

name[R]

Public Class Methods

new(opts) click to toggle source
# File lib/email_predictor/base.rb, line 6
def initialize(opts)
  @name = opts[:name].downcase
end

Public Instance Methods

validate!() click to toggle source

Validate that the name should be in format of firstname lastname

# File lib/email_predictor/base.rb, line 11
def validate!
  unless @name.split(" ").count.eql?(2)
    raise TypeError.new("Oops, the name is not in valid format.  Should be like 'Firstname lastname', Eg: John Ferguson")
  end
end