class BriteVerify::Email

Public Class Methods

new(address, key = ENV['BRITEVERIFY_API_KEY']) click to toggle source
# File lib/brite_verify/email.rb, line 3
def initialize(address, key = ENV['BRITEVERIFY_API_KEY'])
  raise ArgumentError, "Missing BriteVerify API key" if key.nil? || key.strip.empty?
  @address = address
  @key     = key
end

Public Instance Methods

account() click to toggle source
# File lib/brite_verify/email.rb, line 17
def account
  raw_email["account"]
end
address() click to toggle source
# File lib/brite_verify/email.rb, line 13
def address
  raw_email["address"]
end
connected() click to toggle source
# File lib/brite_verify/email.rb, line 29
def connected
  raw_email["connected"].downcase == "true" if raw_email["connected"]
end
disposable() click to toggle source
# File lib/brite_verify/email.rb, line 37
def disposable
  raw_email["disposable"]
end
domain() click to toggle source
# File lib/brite_verify/email.rb, line 21
def domain
  raw_email["domain"]
end
duration() click to toggle source
# File lib/brite_verify/email.rb, line 33
def duration
  raw_email["duration"]
end
error() click to toggle source
# File lib/brite_verify/email.rb, line 49
def error
  raw_email["error"]
end
error_code() click to toggle source
# File lib/brite_verify/email.rb, line 45
def error_code
  raw_email["error_code"]
end
role_address() click to toggle source
# File lib/brite_verify/email.rb, line 41
def role_address
  raw_email["role_address"]
end
status() click to toggle source
# File lib/brite_verify/email.rb, line 25
def status
  raw_email["status"].to_sym if raw_email["status"]
end
verified?() click to toggle source
# File lib/brite_verify/email.rb, line 9
def verified?
  raw_email.keys.any?
end

Private Instance Methods

raw_email() click to toggle source
# File lib/brite_verify/email.rb, line 55
def raw_email
  email_fetcher = EmailFetcher.new(@key)
  @raw_email ||= email_fetcher.fetch_raw_email(@address)
end