Class: Dreamy::User

Inherits:
Object
  • Object
show all
Includes:
EasyClassMaker
Defined in:
lib/dreamy/user.rb

Class Method Summary collapse

Methods included from EasyClassMaker

included, #initialize

Class Method Details

.new_from_xml(xml) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dreamy/user.rb', line 7

def self.new_from_xml(xml)
  u = new
  u.    = (xml).at('account_id').innerHTML.to_i
  u.disk_used_mb  = (xml).at('disk_used_mb').innerHTML.to_f
  u.gecos         = (xml).at('gecos').innerHTML
  u.home          = (xml).at('home').innerHTML
  u.password      = (xml).at('password').innerHTML
  u.quota_mb      = (xml).at('quota_mb').innerHTML.to_i
  u.shell         = (xml).at('shell').innerHTML
  u.type          = (xml).at('type').innerHTML
  u.username      = (xml).at('username').innerHTML
  u
end