Class: Vzaar::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject

Returns the value of attribute account_type_id.



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

def 
  @account_type_id
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#play_countObject

Returns the value of attribute play_count.



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

def play_count
  @play_count
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

#video_countObject

Returns the value of attribute video_count.



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

def video_count
  @video_count
end

#xmlObject

Returns the value of attribute xml.



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

def xml
  @xml
end