Class: NextBigSoundLite::Profile

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

Class Method Summary collapse

Methods inherited from Resource

get, idfy, parse, post

Class Method Details

.add(artist_id, profiles) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/next_big_sound_lite/resources/profile.rb', line 19

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

.artist(id) ⇒ Object



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

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

.resourceObject



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

def self.resource
  super 'profiles'
end

.search(url) ⇒ Object



13
14
15
16
17
# File 'lib/next_big_sound_lite/resources/profile.rb', line 13

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