Class: Dreamy::MysqlDb

Inherits:
Object
  • Object
show all
Includes:
EasyClassMaker
Defined in:
lib/dreamy/mysql/db.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
# File 'lib/dreamy/mysql/db.rb', line 7

def self.new_from_xml(xml)
  db = new
  db.     = (xml).at('account_id').innerHTML.to_i
  db.name           = (xml).at('db').innerHTML
  db.description    = (xml).at('description').innerHTML
  db.home           = (xml).at('home').innerHTML
  db.disk_usage_mb  = (xml).at('disk_usage_mb').innerHTML.to_f
  db
end