Class: NextBigSoundLite::Artist

Inherits:
Resource
  • Object
show all
Defined in:
lib/next_big_sound_lite/resources/artist.rb

Class Method Summary collapse

Methods inherited from Resource

get, idfy, parse, post

Class Method Details

.add(name, profiles) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/next_big_sound_lite/resources/artist.rb', line 25

def self.add(name, profiles)
  params = {
    :key => NextBigSoundLite.private_key,
    :name => name,
    :profiles => profiles
  }
  post resource["add.json"], params
end

.find(id) ⇒ Object Also known as: view



9
10
11
# File 'lib/next_big_sound_lite/resources/artist.rb', line 9

def self.find(id)
  get resource["view/#{id}.json"]
end

.ranking(type, ids) ⇒ Object



20
21
22
23
# File 'lib/next_big_sound_lite/resources/artist.rb', line 20

def self.ranking(type, ids)
  ids = ids.join('-')
  get resource["rank/#{type}/#{ids}.json"]
end

.resourceObject



5
6
7
# File 'lib/next_big_sound_lite/resources/artist.rb', line 5

def self.resource
  super 'artists'
end

.search(q) ⇒ Object



14
15
16
17
18
# File 'lib/next_big_sound_lite/resources/artist.rb', line 14

def self.search(q)
  get resource["search.json?q=#{CGI.escape(q)}"] do |response|
    idfy response
  end
end