Class: Whm::Account
- Inherits:
-
Object
- Object
- Whm::Account
- Includes:
- Validatable, Parameters
- Defined in:
- lib/whm/account.rb
Overview
:nodoc:
Constant Summary collapse
- @@default_attributes =
{}
- @@writable_attributes =
%w(username domain plan pkgname savepkg featurelist quota password ip cgi frontpage hasshell contactemail cpmod maxftp maxsql maxpop maxlst maxsub maxpark maxaddon bwlimit customip language useregns hasuseregns reseller)
- @@readonly_attributes =
%w(disklimit diskused email ip owner partition plan startdate suspended suspendreason theme unix_startdate user)
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#server ⇒ Object
Returns the value of attribute server.
-
#writable_attributes ⇒ Object
Returns the value of attribute writable_attributes.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Account
constructor
A new instance of Account.
- #package=(new_package) ⇒ Object
- #password=(password) ⇒ Object
- #suspend!(reason = '') ⇒ Object
- #terminate!(keepdns = "n") ⇒ Object
- #unsuspend! ⇒ Object
- #user ⇒ Object (also: #name)
Methods included from Parameters
#booleans!, #requires!, #valid_options!
Constructor Details
#initialize(attributes = {}) ⇒ Account
Returns a new instance of Account.
17 18 19 20 |
# File 'lib/whm/account.rb', line 17 def initialize(attributes = {}) self.attributes = attributes self.writable_attributes = {} end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
9 10 11 |
# File 'lib/whm/account.rb', line 9 def attributes @attributes end |
#server ⇒ Object
Returns the value of attribute server.
8 9 10 |
# File 'lib/whm/account.rb', line 8 def server @server end |
#writable_attributes ⇒ Object
Returns the value of attribute writable_attributes.
10 11 12 |
# File 'lib/whm/account.rb', line 10 def writable_attributes @writable_attributes end |
Instance Method Details
#package=(new_package) ⇒ Object
59 60 61 |
# File 'lib/whm/account.rb', line 59 def package=( new_package) server.change_package(:user => user, :pkg => new_package) end |
#password=(password) ⇒ Object
43 44 45 |
# File 'lib/whm/account.rb', line 43 def password=(password) server.change_account_password(:user => user, :pass => password) end |
#suspend!(reason = '') ⇒ Object
47 48 49 |
# File 'lib/whm/account.rb', line 47 def suspend!( reason = '') server.suspend_account(:user => user, :reason => reason) end |
#terminate!(keepdns = "n") ⇒ Object
55 56 57 |
# File 'lib/whm/account.rb', line 55 def terminate!( keepdns = "n") server.terminate_account(:user => user,:keepdns => keepdns) end |
#unsuspend! ⇒ Object
51 52 53 |
# File 'lib/whm/account.rb', line 51 def unsuspend! server.unsuspend_account(:user => user) end |
#user ⇒ Object Also known as: name
22 23 24 |
# File 'lib/whm/account.rb', line 22 def user self.attributes['user'] end |