Project

ced

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby interface for CED's email verification service.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.0.3
~> 1.9.0
 Project Readme

CED

The Central Email Database is an email verification service. You pass it an email address and it tells you if the email address is real or not. This gem wraps the API in a more Ruby friendly syntax. CED also corrects common typos in email domains.

Installation

The CED gem is Ruby 1.9.x and 2.0.x compatible.

Add this line to your application's Gemfile:

gem 'ced'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ced -P LowSecurity

Usage

Minimum workable example:

require "ced"
 => true
email = CED::Email.new("john@example.con", "ced.example.com", "client", "key")
 => #<CED::Email:0x007ffd4198c358 @address="john@example.con", @client="client", @key="key">
email.verified?
 => true
email.corrected_email
 => "john@example.com"
email.valid?
 => false
email.seen_before?
 => true
email.error
 => "Invalid domain name"
email.error_code
 => "invalid_domain_name"

You can skip the host, client and key parameters and specify the ENV['CED_HOST'], ENV['CED_CLIENT'] and ENV['CED_KEY'] environment variable for convenience.

WARNING Don't blindly trust email.valid? as it will also return false when the request failed. Always check for email.verified? before inspecting the other attributes!

Contributing

Something missing? Found a bug? Horrified by the code? Open a github issue, write a failing test or add some code using pull requests. Your help is greatly appreciated!