Class: Divshare::User

Inherits:
Object
  • Object
show all
Defined in:
lib/divshare/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ User

Returns a new instance of User.



4
5
6
7
# File 'lib/divshare/user.rb', line 4

def initialize(xml)
  @name = xml.at(:user_fname).inner_html
  @email = xml.at(:user_email).inner_html
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/divshare/user.rb', line 3

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/divshare/user.rb', line 3

def name
  @name
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/divshare/user.rb', line 9

def to_s
  "#{@name} <#{@email}>"
end