Class: PleskLib::Actions::CreateAccount
- Inherits:
-
Base
- Object
- Base
- PleskLib::Actions::CreateAccount
show all
- Defined in:
- lib/plesk_lib/actions/create_account.rb
Instance Method Summary
collapse
Methods inherited from Base
#execute_on
Instance Method Details
#analyse(xml_document) ⇒ Object
18
19
20
21
22
|
# File 'lib/plesk_lib/actions/create_account.rb', line 18
def analyse(xml_document)
add_node = xml_document.root.locate('*/result').first
@plesk_id = add_node.id.text.to_i
@guid = add_node.guid.text
end
|
#build_gen_info(xml, account, tag_name = 'gen_info') ⇒ Object
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/plesk_lib/actions/create_account.rb', line 2
def build_gen_info(xml, account, tag_name = 'gen_info')
xml.tag!(tag_name) {
xml.cname(account.company_name)
xml.pname(account.person_name)
xml.login(account.login) if account.login.present?
xml.passwd(account.password) if account.password.present?
xml.pcode(account.pcode) if account.postal_code.present?
%w(status phone fax address city state email country).each do |attribute|
value = account.send(attribute)
xml.tag!(attribute, value) if value.present?
end
xml.tag!('owner-id', account.owner_id) if account.owner_id.present?
}
return xml.target!
end
|