Module: Ronnie::Client::Albums

Included in:
Ronnie::Client
Defined in:
lib/ronnie/client/albums.rb

Instance Method Summary collapse

Instance Method Details

#album(album_id, options = {}) ⇒ Object

Retrieve Album

Examples:

Ronnie.album('a610550')

Parameters:

  • album_id (String)


9
10
11
# File 'lib/ronnie/client/albums.rb', line 9

def album(album_id, options={})
  post('get', { keys: album_id })
end

#find_albums_by_artist(artist_id, options = {}) ⇒ Object

Find Albums by Artist

Examples:

Ronnie.find_albums_by_artist('r235282')

Parameters:

  • artist_id (String)


18
19
20
# File 'lib/ronnie/client/albums.rb', line 18

def find_albums_by_artist(artist_id, options={})
  post('getAlbumsForArtist', { artist: artist_id })
end

#find_albums_by_label(label_id, options = {}) ⇒ Object

Find Albums by Label

Examples:

Ronnie.find_albums_by_upc('r235282')

Parameters:

  • label_id (String)


27
28
29
# File 'lib/ronnie/client/albums.rb', line 27

def find_albums_by_label(label_id, options={})
  post('getAlbumsForLabel', { label: label_id })
end

#find_albums_by_upc(upc, options = {}) ⇒ Object

Find Albums by UPC

Examples:

Ronnie.find_albums_by_upc('r235282')

Parameters:

  • upc (String)


36
37
38
# File 'lib/ronnie/client/albums.rb', line 36

def find_albums_by_upc(upc, options={})
  post('getAlbumsByUPC', { upc: upc })
end

#heavily_rotated_albums(user_id = nil, friends = nil, options = {}) ⇒ Object

retrieve heavily rotated albums.

Examples:

Ronnie.heavily_rotated_albums


61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/ronnie/client/albums.rb', line 61

def heavily_rotated_albums(user_id=nil, friends=nil, options={})
  if user_id 
    required_options = { user: user_id, type: 'albums' }

    if friends
      required_options = required_options.merge!({ friends: friends })
    end
  else
    required_options = { type: 'albums' }
  end

  post('getHeavyRotation', required_options.merge!(options))
end

#new_releases(options = {}) ⇒ Object

Retrieve new releases.

Examples:

Ronnie.new_releases


53
54
55
# File 'lib/ronnie/client/albums.rb', line 53

def new_releases(options={})
  post('getNewReleases')
end

#search_albums(query, options = {}) ⇒ Object

Search Albums

Examples:

Ronnie.search_albums('Clear Moon')

Parameters:

  • query (String)


45
46
47
# File 'lib/ronnie/client/albums.rb', line 45

def search_albums(query, options={})
  post('search', { query: query, types: 'Album' })
end

#top_albums(options = {}) ⇒ Object

retrieve the site-wide most popular albums.

Examples:

Ronnie.top_albums


79
80
81
# File 'lib/ronnie/client/albums.rb', line 79

def top_albums(options={})
  post('getTopCharts', { type: "Album" })
end