Class: Rdio::Artist
- Inherits:
-
ArtistData
- Object
- ApiObj
- BaseObj
- ArtistData
- Rdio::Artist
- Defined in:
- lib/rdio/types.rb
Overview
Represents an artist on Rdio, either an individual performer or a group
Instance Attribute Summary collapse
-
#album_keys ⇒ Object
Returns the value of attribute album_keys.
-
#albums(featuring = nil, extras = nil, start = nil, count = nil) ⇒ Object
Get all the albums by this artist.
-
#artist_name ⇒ Object
Returns the value of attribute artist_name.
-
#artist_url ⇒ Object
Returns the value of attribute artist_url.
-
#count ⇒ Object
Returns the value of attribute count.
-
#frozen_track_list ⇒ Object
Returns the value of attribute frozen_track_list.
-
#has_offline ⇒ Object
Returns the value of attribute has_offline.
-
#id ⇒ Object
Returns the value of attribute id.
-
#play_count ⇒ Object
Returns the value of attribute play_count.
-
#secondary_id ⇒ Object
Returns the value of attribute secondary_id.
-
#sortable_name ⇒ Object
Returns the value of attribute sortable_name.
-
#tracks(appears_on = nil, start = nil, count = nil, extras = nil) ⇒ Object
Get all of the tracks by this artist.
-
#user_key ⇒ Object
Returns the value of attribute user_key.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Attributes inherited from ArtistData
#album_count, #base_icon, #has_radio, #icon, #length, #name, #short_url, #type, #url
Attributes inherited from BaseObj
Attributes inherited from ApiObj
Class Method Summary collapse
-
.all(keys, extras = nil) ⇒ Object
Fetch one or more objects from Rdio of type Artist.
-
.from_short_code(short_code) ⇒ Object
Return the Artist that the supplied Rdio short-code is a representation of, or null if the short-code is invalid.
-
.from_url(url) ⇒ Object
Return the Artist that the supplied Rdio url is a representation of, or null if the url doesn’t represent an object.
-
.get(key, extras = nil) ⇒ Object
Fetch one object from Rdio of type Artist.
-
.search(query, never_or = nil, extras = nil, start = nil, count = nil) ⇒ Object
Returns an array of Artist for the query and other params.
-
.top_charts ⇒ Object
Return the site-wide most popular items for Artists.
Instance Method Summary collapse
-
#in_collection(user = nil, start = nil, count = nil, sort = nil, query = nil) ⇒ Object
Get all of the artist in a user’s collection.
-
#initialize(api) ⇒ Artist
constructor
A new instance of Artist.
-
#tracks_in_collection(user = nil, extras = nil) ⇒ Object
Which tracks from the given artist are in the user’s collection.
Methods inherited from BaseObj
Methods inherited from ApiObj
Constructor Details
#initialize(api) ⇒ Artist
Returns a new instance of Artist.
11 12 13 |
# File 'lib/rdio/types.rb', line 11 def initialize(api) super api end |
Instance Attribute Details
#album_keys ⇒ Object
Returns the value of attribute album_keys.
31 32 33 |
# File 'lib/rdio/types.rb', line 31 def album_keys @album_keys end |
#albums(featuring = nil, extras = nil, start = nil, count = nil) ⇒ Object
Get all the albums by this artist
45 46 47 |
# File 'lib/rdio/types.rb', line 45 def albums @albums end |
#artist_name ⇒ Object
Returns the value of attribute artist_name.
27 28 29 |
# File 'lib/rdio/types.rb', line 27 def artist_name @artist_name end |
#artist_url ⇒ Object
Returns the value of attribute artist_url.
25 26 27 |
# File 'lib/rdio/types.rb', line 25 def artist_url @artist_url end |
#count ⇒ Object
Returns the value of attribute count.
18 19 20 |
# File 'lib/rdio/types.rb', line 18 def count @count end |
#frozen_track_list ⇒ Object
Returns the value of attribute frozen_track_list.
24 25 26 |
# File 'lib/rdio/types.rb', line 24 def frozen_track_list @frozen_track_list end |
#has_offline ⇒ Object
Returns the value of attribute has_offline.
19 20 21 |
# File 'lib/rdio/types.rb', line 19 def has_offline @has_offline end |
#id ⇒ Object
Returns the value of attribute id.
21 22 23 |
# File 'lib/rdio/types.rb', line 21 def id @id end |
#play_count ⇒ Object
Returns the value of attribute play_count.
16 17 18 |
# File 'lib/rdio/types.rb', line 16 def play_count @play_count end |
#secondary_id ⇒ Object
Returns the value of attribute secondary_id.
17 18 19 |
# File 'lib/rdio/types.rb', line 17 def secondary_id @secondary_id end |
#sortable_name ⇒ Object
Returns the value of attribute sortable_name.
20 21 22 |
# File 'lib/rdio/types.rb', line 20 def sortable_name @sortable_name end |
#tracks(appears_on = nil, start = nil, count = nil, extras = nil) ⇒ Object
Get all of the tracks by this artist.
40 41 42 |
# File 'lib/rdio/types.rb', line 40 def tracks @tracks end |
#user_key ⇒ Object
Returns the value of attribute user_key.
26 27 28 |
# File 'lib/rdio/types.rb', line 26 def user_key @user_key end |
#user_name ⇒ Object
Returns the value of attribute user_name.
23 24 25 |
# File 'lib/rdio/types.rb', line 23 def user_name @user_name end |
Class Method Details
.all(keys, extras = nil) ⇒ Object
Fetch one or more objects from Rdio of type Artist.
55 56 57 |
# File 'lib/rdio/types.rb', line 55 def self.all(keys,extras=nil) Rdio::api.get keys,Artist,extras end |
.from_short_code(short_code) ⇒ Object
Return the Artist that the supplied Rdio short-code is a representation of, or null if the short-code is invalid.
72 73 74 |
# File 'lib/rdio/types.rb', line 72 def self.from_short_code(short_code) Rdio::api.getObjectFromShortCode short_code,Artist end |
.from_url(url) ⇒ Object
Return the Artist that the supplied Rdio url is a representation of, or null if the url doesn’t represent an object.
78 79 80 |
# File 'lib/rdio/types.rb', line 78 def self.from_url(url) Rdio::api.getObjectFromUrl url,Artist end |
.get(key, extras = nil) ⇒ Object
Fetch one object from Rdio of type Artist.
60 61 62 63 |
# File 'lib/rdio/types.rb', line 60 def self.get(key,extras=nil) arr = all [key],extras (arr and not arr.empty?) ? arr[0] : nil end |
.search(query, never_or = nil, extras = nil, start = nil, count = nil) ⇒ Object
Returns an array of Artist for the query and other params
34 35 36 37 |
# File 'lib/rdio/types.rb', line 34 def self.search(query,never_or=nil,extras=nil,start=nil,count=nil) extras = Rdio::add_to_array extras,'artists' Search.search query,Artist,never_or,extras,start,count end |
Instance Method Details
#in_collection(user = nil, start = nil, count = nil, sort = nil, query = nil) ⇒ Object
Get all of the artist in a user’s collection.
66 67 68 |
# File 'lib/rdio/types.rb', line 66 def in_collection(user=nil,start=nil,count=nil,sort=nil,query=nil) api.getArtistsInCollection user,start,count,sort,query end |
#tracks_in_collection(user = nil, extras = nil) ⇒ Object
Which tracks from the given artist are in the user’s collection.
50 51 52 |
# File 'lib/rdio/types.rb', line 50 def tracks_in_collection(user=nil,extras=nil) api.getTracksForArtistInCollection self,user,extras end |