Module: Emailable
- Defined in:
- lib/emailable.rb,
lib/emailable/batch.rb,
lib/emailable/client.rb,
lib/emailable/errors.rb,
lib/emailable/version.rb,
lib/emailable/response.rb,
lib/emailable/resources/account.rb,
lib/emailable/resources/api_resource.rb,
lib/emailable/resources/batch_status.rb,
lib/emailable/resources/verification.rb
Defined Under Namespace
Classes: APIResource, Account, BadRequestError, Batch, BatchStatus, Client, Error, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, Response, ServiceUnavailableError, TimeoutError, TooManyRequestsError, UnauthorizedError, Verification
Constant Summary collapse
- VERSION =
'4.1.0'
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.max_network_retries ⇒ Object
Returns the value of attribute max_network_retries.
-
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
.read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
.write_timeout ⇒ Object
Returns the value of attribute write_timeout.
Class Method Summary collapse
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
25 26 27 |
# File 'lib/emailable.rb', line 25 def api_key @api_key end |
.max_network_retries ⇒ Object
Returns the value of attribute max_network_retries.
25 26 27 |
# File 'lib/emailable.rb', line 25 def max_network_retries @max_network_retries end |
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
25 26 27 |
# File 'lib/emailable.rb', line 25 def open_timeout @open_timeout end |
.read_timeout ⇒ Object
Returns the value of attribute read_timeout.
25 26 27 |
# File 'lib/emailable.rb', line 25 def read_timeout @read_timeout end |
.write_timeout ⇒ Object
Returns the value of attribute write_timeout.
25 26 27 |
# File 'lib/emailable.rb', line 25 def write_timeout @write_timeout end |
Class Method Details
.account ⇒ Object
44 45 46 47 48 |
# File 'lib/emailable.rb', line 44 def account client = Emailable::Client.new response = client.request(:get, 'account') Account.new(response.body) end |
.verify(email, parameters = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/emailable.rb', line 31 def verify(email, parameters = {}) parameters[:email] = email client = Emailable::Client.new response = client.request(:get, 'verify', parameters) if response.status == 249 raise Emailable::TimeoutError.new(response.body) else Verification.new(response.body) end end |