class SmtpcomApi::Account

Constants

ACCESSORS
ATTRIBUTES
READERS

Public Class Methods

new(api_key, api_host) click to toggle source
Calls superclass method
# File lib/smtpcom_api/account.rb, line 12
def initialize(api_key, api_host)
  super
  reload
end

Public Instance Methods

dashboard() click to toggle source
# File lib/smtpcom_api/account.rb, line 22
def dashboard
  st = @reset_quota_at.to_i>0 ? @reset_quota_at - 30*24*24 : now.to_i - 30*24*60*60
  get(:dashboard, :time_end => now.to_i, :time_start => st)['dashboard']
end
reload() click to toggle source
# File lib/smtpcom_api/account.rb, line 17
def reload
  set_attributes get(:account)['account']
  self
end
save() click to toggle source
# File lib/smtpcom_api/account.rb, line 27
def save
  update = attributes.select{|k| ACCESSORS.include? k}
  put :account, :account => update
  self
end