Class: Vzaar::User
- Inherits:
-
Object
- Object
- Vzaar::User
- Defined in:
- lib/vzaar/user.rb
Instance Attribute Summary collapse
-
#account_type_id ⇒ Object
Returns the value of attribute account_type_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#play_count ⇒ Object
Returns the value of attribute play_count.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
-
#video_count ⇒ Object
Returns the value of attribute video_count.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(xml) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(xml) ⇒ User
Returns a new instance of User.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vzaar/user.rb', line 8 def initialize(xml) @xml = xml doc = REXML::Document.new xml @version = doc.elements['user/version'] ? doc.elements['user/version'].text : '' @id = doc.elements['user/author_id'] ? doc.elements['user/author_id'].text : '' @name = doc.elements['user/author_name'] ? doc.elements['user/author_name'].text : '' @url = doc.elements['user/author_url'] ? doc.elements['user/author_url'].text : '' @account_type_id = doc.elements['user/author_account'] ? doc.elements['user/author_account'].text : '' @created_at = doc.elements['user/created_at'] ? doc.elements['user/created_at'].text : '' @video_count = doc.elements['user/video_count'] ? doc.elements['user/video_count'].text : '' @play_count = doc.elements['user/play_count'] ? doc.elements['user/play_count'].text : '' end |
Instance Attribute Details
#account_type_id ⇒ Object
Returns the value of attribute account_type_id.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def account_type_id @account_type_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def name @name end |
#play_count ⇒ Object
Returns the value of attribute play_count.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def play_count @play_count end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def version @version end |
#video_count ⇒ Object
Returns the value of attribute video_count.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def video_count @video_count end |
#xml ⇒ Object
Returns the value of attribute xml.
5 6 7 |
# File 'lib/vzaar/user.rb', line 5 def xml @xml end |