Module: Mailgun
- Defined in:
- lib/mailgun/log.rb,
lib/mailgun/base.rb,
lib/mailgun/list.rb,
lib/mailgun/mail.rb,
lib/mailgun/route.rb,
lib/mailgun/bounce.rb,
lib/mailgun/mailbox.rb,
lib/mailgun/complaint.rb,
lib/mailgun/list/member.rb,
lib/mailgun/unsubscribe.rb,
lib/mailgun/mailgun_error.rb
Defined Under Namespace
Classes: Base, Bounce, Complaint, Error, List, Log, Mail, Mailbox, Route, Unsubscribe
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.
-
.mailgun_host ⇒ Object
Returns the value of attribute mailgun_host.
-
.protocol ⇒ Object
Returns the value of attribute protocol.
-
.test_mode ⇒ Object
Returns the value of attribute test_mode.
Class Method Summary collapse
- .configure {|_self| ... } ⇒ Object (also: config)
-
.submit(method, url, parameters = {}) ⇒ Object
Submits the API call to the Mailgun server.
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
79 80 81 |
# File 'lib/mailgun/base.rb', line 79 def api_key @api_key end |
.api_version ⇒ Object
Returns the value of attribute api_version.
79 80 81 |
# File 'lib/mailgun/base.rb', line 79 def api_version @api_version end |
.domain ⇒ Object
Returns the value of attribute domain.
79 80 81 |
# File 'lib/mailgun/base.rb', line 79 def domain @domain end |
.mailgun_host ⇒ Object
Returns the value of attribute mailgun_host.
79 80 81 |
# File 'lib/mailgun/base.rb', line 79 def mailgun_host @mailgun_host end |
.protocol ⇒ Object
Returns the value of attribute protocol.
79 80 81 |
# File 'lib/mailgun/base.rb', line 79 def protocol @protocol end |
.test_mode ⇒ Object
Returns the value of attribute test_mode.
79 80 81 |
# File 'lib/mailgun/base.rb', line 79 def test_mode @test_mode end |
Class Method Details
.configure {|_self| ... } ⇒ Object Also known as: config
86 87 88 89 |
# File 'lib/mailgun/base.rb', line 86 def configure yield self true end |
.submit(method, url, parameters = {}) ⇒ Object
Submits the API call to the Mailgun server
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mailgun/base.rb', line 58 def self.submit(method, url, parameters={}) begin return JSON(RestClient.send(method, url, parameters)) rescue => e = nil if e.respond_to? :http_body begin = JSON(e.http_body)["message"] rescue raise e end raise Mailgun::Error.new() end raise e end end |