Class: Soundcloud2::Playlists

Inherits:
Client
  • Object
show all
Defined in:
lib/soundcloud2/playlists.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Client

#groups, #method_missing, #tracks, #users

Constructor Details

#initialize(*args) ⇒ Playlists

Initialize on the Soundcloud::Client class



6
7
8
# File 'lib/soundcloud2/playlists.rb', line 6

def initialize(*args)
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Soundcloud2::Client

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



3
4
5
# File 'lib/soundcloud2/playlists.rb', line 3

def api_key
  @api_key
end

#connObject (readonly)

Returns the value of attribute conn.



3
4
5
# File 'lib/soundcloud2/playlists.rb', line 3

def conn
  @conn
end

Instance Method Details

#playlists(*args) ⇒ Object



10
11
12
13
14
# File 'lib/soundcloud2/playlists.rb', line 10

def playlists(*args)
  options = args.extract_options!.merge(:client_id => api_key)
  response = conn.get("/playlists/#{args[0]}.json") { |req| req.params = options }
  args.nil? ? response.body.send(sym) : response.body
end

#playlists_shared_to_emails(*args) ⇒ Object

GET /playlists/id/shared-to/emails email addresses who are invited to the playlist



24
25
26
27
28
# File 'lib/soundcloud2/playlists.rb', line 24

def playlists_shared_to_emails(*args)
  options = args.extract_options!.merge(:client_id => api_key)
  response = conn.get("/playlists/#{args[0]}/shared-to/emails.json") { |req| req.params = options }
  args.nil? ? response.body.send(sym) : response.body
end

#playlists_shared_to_users(*args) ⇒ Object

GET /playlists/id/shared-to/users users who have access to the track



17
18
19
20
21
# File 'lib/soundcloud2/playlists.rb', line 17

def playlists_shared_to_users(*args)
  options = args.extract_options!.merge(:client_id => api_key)
  response = conn.get("/playlists/#{args[0]}/shared-to/users.json") { |req| req.params = options }
  args.nil? ? response.body.send(sym) : response.body
end