Class: Mailgun::Domain
Overview
Interface to manage domains
Instance Method Summary collapse
-
#create(domain, opts = {}) ⇒ Object
Add domain to account.
-
#delete(domain) ⇒ Object
Remves a domain from account.
-
#find(domain) ⇒ Object
Find domain by name.
-
#initialize(mailgun) ⇒ Domain
constructor
Used internally, called from Mailgun::Base.
-
#list(options = {}) ⇒ Object
List all domains on the account.
-
#verify(domain) ⇒ Object
Verifies a domain from account (Check DNS Records Now from Mailgun Web UI) The method is still in beta and you will need access from Mailgun to use it.
Constructor Details
#initialize(mailgun) ⇒ Domain
Used internally, called from Mailgun::Base
6 7 8 |
# File 'lib/mailgun/domain.rb', line 6 def initialize(mailgun) @mailgun = mailgun end |
Instance Method Details
#create(domain, opts = {}) ⇒ Object
Add domain to account
21 22 23 24 |
# File 'lib/mailgun/domain.rb', line 21 def create(domain, opts = {}) opts = {name: domain}.merge(opts) Mailgun.submit :post, domain_url, opts end |
#delete(domain) ⇒ Object
Remves a domain from account
27 28 29 |
# File 'lib/mailgun/domain.rb', line 27 def delete(domain) Mailgun.submit :delete, domain_url(domain) end |
#find(domain) ⇒ Object
Find domain by name
16 17 18 |
# File 'lib/mailgun/domain.rb', line 16 def find(domain) Mailgun.submit :get, domain_url(domain) end |