Module: Rubymail
- Defined in:
- lib/rubymail/log.rb,
lib/rubymail/base.rb,
lib/rubymail/list.rb,
lib/rubymail/route.rb,
lib/rubymail/bounce.rb,
lib/rubymail/client.rb,
lib/rubymail/client.rb,
lib/rubymail/domain.rb,
lib/rubymail/secure.rb,
lib/rubymail/address.rb,
lib/rubymail/mailbox.rb,
lib/rubymail/message.rb,
lib/rubymail/webhook.rb,
lib/rubymail/complaint.rb,
lib/rubymail/unsubscribe.rb,
lib/rubymail/rubymail_error.rb
Defined Under Namespace
Classes: Address, BadRequest, Base, Bounce, Client, ClientError, Complaint, Domain, Error, ErrorBase, Log, Mailbox, MailingList, Message, NotFound, ResquestFailed, Route, Secure, ServerError, Unauthorized, Unsubscribe, Webhook
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.api_version ⇒ Object
Returns the value of attribute api_version.
-
.domain ⇒ Object
Returns the value of attribute domain.
-
.protocol ⇒ Object
Returns the value of attribute protocol.
-
.public_api_key ⇒ Object
Returns the value of attribute public_api_key.
-
.rubymail_host ⇒ Object
Returns the value of attribute rubymail_host.
-
.test_mode ⇒ Object
Returns the value of attribute test_mode.
-
.webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Class Method Summary collapse
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def api_key @api_key end |
.api_version ⇒ Object
Returns the value of attribute api_version.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def api_version @api_version end |
.domain ⇒ Object
Returns the value of attribute domain.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def domain @domain end |
.protocol ⇒ Object
Returns the value of attribute protocol.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def protocol @protocol end |
.public_api_key ⇒ Object
Returns the value of attribute public_api_key.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def public_api_key @public_api_key end |
.rubymail_host ⇒ Object
Returns the value of attribute rubymail_host.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def rubymail_host @rubymail_host end |
.test_mode ⇒ Object
Returns the value of attribute test_mode.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def test_mode @test_mode end |
.webhook_url ⇒ Object
Returns the value of attribute webhook_url.
103 104 105 |
# File 'lib/rubymail/base.rb', line 103 def webhook_url @webhook_url end |
Class Method Details
.configure {|_self| ... } ⇒ Object Also known as: config
112 113 114 115 |
# File 'lib/rubymail/base.rb', line 112 def configure yield self true end |
.submit(method, url, parameters = {}) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/rubymail/base.rb', line 80 def self.submit(method, url, parameters={}) begin JSON.parse(Client.new(url).send(method, parameters)) rescue => e error_code = e.http_code = begin JSON(e.http_body)["message"] rescue JSON::ParserError '' end error = Rubymail::Error.new( :code => error_code || nil, :message => || nil ) if error.handle.kind_of? Rubymail::ErrorBase raise error.handle else raise error end end end |