Class: Lumberg::Cpanel::Contact

Inherits:
Base show all
Defined in:
lib/lumberg/cpanel/contact.rb

Overview

Public: Allows users to specify contact information and preferences

Instance Attribute Summary

Attributes inherited from Base

#api_username

Attributes inherited from Whm::Base

#server

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #perform_request

Methods inherited from Whm::Base

#initialize, #setup_server

Constructor Details

This class inherits a constructor from Lumberg::Cpanel::Base

Class Method Details

.api_moduleObject



5
# File 'lib/lumberg/cpanel/contact.rb', line 5

def self.api_module; "CustInfo"; end

Instance Method Details

#showObject

Public: Show your contact information and email notfication settings

Returns Hash API response



10
11
12
# File 'lib/lumberg/cpanel/contact.rb', line 10

def show
  perform_request({ api_function: 'displaycontactinfo' })
end

#update(options = {}) ⇒ Object

Public: Updates the user's contact info and settings for email notifications

options - Hash options for API call params (default: {})

:email - String email account to send notifications to
:second_email - String secondary email account to send notifications
                to (default: String)
:email_quota - Boolean value. Set to true to be notified when you are
               when one of your email accounts approaches or is over
               quota (default: Boolean)
:disk_quota - Boolean value. Set to true to be notified when you are
              when you are reaching your disk quota (default: Boolean)
:bandwidth - Boolean value. Set to true to be notified when you are
             reaching your bandwidth usage limit (default: Boolean)

Returns Hash API response



30
31
32
33
34
35
# File 'lib/lumberg/cpanel/contact.rb', line 30

def update(options = {})
  options[:notify_disk_limit] = options.delete(:disk_quota)
  options[:notify_bandwidth_limit] = options.delete(:bandwidth)
  options[:notify_email_quota_limit] = options.delete(:email_quota)
  perform_request({ api_function: 'savecontactinfo' }.merge(options))
end