Module: Mailgun
- Defined in:
- lib/mailgun/log.rb,
lib/mailgun/base.rb,
lib/mailgun/list.rb,
lib/mailgun/route.rb,
lib/mailgun/bounce.rb,
lib/mailgun/domain.rb,
lib/mailgun/mailbox.rb,
lib/mailgun/message.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, Domain, Error, Log, Mailbox, MailingList, Message, 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.
90 91 92 |
# File 'lib/mailgun/base.rb', line 90 def api_key @api_key end |
.api_version ⇒ Object
Returns the value of attribute api_version.
90 91 92 |
# File 'lib/mailgun/base.rb', line 90 def api_version @api_version end |
.domain ⇒ Object
Returns the value of attribute domain.
90 91 92 |
# File 'lib/mailgun/base.rb', line 90 def domain @domain end |
.mailgun_host ⇒ Object
Returns the value of attribute mailgun_host.
90 91 92 |
# File 'lib/mailgun/base.rb', line 90 def mailgun_host @mailgun_host end |
.protocol ⇒ Object
Returns the value of attribute protocol.
90 91 92 |
# File 'lib/mailgun/base.rb', line 90 def protocol @protocol end |
.test_mode ⇒ Object
Returns the value of attribute test_mode.
90 91 92 |
# File 'lib/mailgun/base.rb', line 90 def test_mode @test_mode end |
Class Method Details
.configure {|_self| ... } ⇒ Object Also known as: config
97 98 99 100 |
# File 'lib/mailgun/base.rb', line 97 def configure yield self true end |
.submit(method, url, parameters = {}) ⇒ Object
Submits the API call to the Mailgun server
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/mailgun/base.rb', line 68 def self.submit(method, url, parameters={}) begin parameters = {:params => parameters} if method == :get 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 |