Class: MTV::Music::Artist

Inherits:
Base
  • Object
show all
Defined in:
lib/mtv-music/base.rb,
lib/mtv-music/artist.rb

Instance Attribute Summary

Attributes inherited from Base

#id, #uri

Instance Method Summary collapse

Methods inherited from Base

api_path, attribute, attributes, fetch_and_parse, #initialize, #initialize_with_polymorphism, name_with_demodulization, search

Constructor Details

This class inherits a constructor from MTV::Music::Base

Instance Method Details



12
13
14
15
# File 'lib/mtv-music/artist.rb', line 12

def related
  xml = Artist.fetch_and_parse(self.class.api_path(:related, self.id))
  return xml.search("entry/id").collect{|elem| Artist.new(Artist.fetch_and_parse(elem.inner_text))}
end

#videosObject



7
8
9
10
# File 'lib/mtv-music/artist.rb', line 7

def videos
  xml = Video.fetch_and_parse(self.class.api_path(:videos, self.id))
  return xml.search("entry/id").collect{|elem| Video.new(Video.fetch_and_parse(elem.inner_text))}
end