module Freemail

Constants

DISPOSABLE
FREE
ROOT
VERSION

Public Class Methods

add_disposable_domains(custom_domains) click to toggle source
# File lib/freemail.rb, line 8
def self.add_disposable_domains(custom_domains)
  custom_domains = [custom_domains] unless custom_domains.is_a? Array
  custom_domains.each { |domain| DISPOSABLE[domain] = nil }
end
add_free_domains(custom_domains) click to toggle source
# File lib/freemail.rb, line 13
def self.add_free_domains(custom_domains)
  custom_domains = [custom_domains] unless custom_domains.is_a? Array
  custom_domains.each { |domain| FREE[domain] = nil }
end
disposable?(email) click to toggle source
# File lib/freemail.rb, line 22
def self.disposable?(email)
  DISPOSABLE.key?(get_domain(email))
end
free?(email) click to toggle source
# File lib/freemail.rb, line 18
def self.free?(email)
  FREE.key?(get_domain(email))
end
free_or_disposable?(email) click to toggle source
# File lib/freemail.rb, line 26
def self.free_or_disposable?(email)
  free?(email) || disposable?(email)
end
get_domain(email) click to toggle source
# File lib/freemail.rb, line 30
def self.get_domain(email)
  email.split('@').last.downcase.strip
end