Sha256: 45c4c3fcce88e612f9a8a926641af23647d8112807a04c59736c5ad3444a8809

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 Bytes

Contents

module Dreamy
  class User
    include EasyClassMaker

    attributes  :account_id, :disk_used_mb, :gecos, :home, :password, :quota_mb, :shell, :type, :username

    def self.new_from_xml(xml)
      u = new
      u.account_id    = (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
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
jordan-brough-dreamy-0.5.1 lib/dreamy/user.rb
sant0sk1-dreamy-0.3.0 lib/dreamy/user.rb
sant0sk1-dreamy-0.4.1 lib/dreamy/user.rb
sant0sk1-dreamy-0.5.0 lib/dreamy/user.rb
sant0sk1-dreamy-0.5.1 lib/dreamy/user.rb
dreamy-0.5.3 lib/dreamy/user.rb
dreamy-0.5.2 lib/dreamy/user.rb
dreamy-0.5.1 lib/dreamy/user.rb