class SmtpcomApi::Client

Attributes

api_key[R]
host[R]

Public Class Methods

new(api_key, api_host='http://api.smtp.com') click to toggle source
# File lib/smtpcom_api/client.rb, line 10
def initialize(api_key, api_host='http://api.smtp.com')
  @api_key  = api_key
  @api_host = api_host
end

Public Instance Methods

account() click to toggle source
# File lib/smtpcom_api/client.rb, line 15
def account
  SmtpcomApi::Account.new(@api_key, @api_host)
end
add_sender(attributes) click to toggle source
# File lib/smtpcom_api/client.rb, line 23
def add_sender(attributes)
  SmtpcomApi::Sender.new(attributes[:label], @api_key, @api_host, post(:senders, :sender => attributes)['sender'])
end
Also aliased as: create_sender
create_sender(attributes)
Alias for: add_sender
sender(label) click to toggle source
# File lib/smtpcom_api/client.rb, line 19
def sender(label)
  SmtpcomApi::Sender.new(label, @api_key, @api_host)
end
senders() click to toggle source
# File lib/smtpcom_api/client.rb, line 28
def senders
  get(:senders)['senders'].map{|s| SmtpcomApi::Sender.new(s['label'], @api_key, @api_host, s) }
end