Class: Divshare::User
- Inherits:
-
Object
- Object
- Divshare::User
- Defined in:
- lib/divshare/user.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(xml) ⇒ User
constructor
A new instance of User.
- #to_s ⇒ Object
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
#email ⇒ Object (readonly)
Returns the value of attribute email.
3 4 5 |
# File 'lib/divshare/user.rb', line 3 def email @email end |
#name ⇒ Object (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_s ⇒ Object
9 10 11 |
# File 'lib/divshare/user.rb', line 9 def to_s "#{@name} <#{@email}>" end |