Class: Soundcloud2::Groups
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
Instance Method Summary collapse
-
#groups(*args) ⇒ Object
GET /groups/id a group.
-
#groups_contributors(*args) ⇒ Object
GET /groups/id/contributors list of users who contributed a track to the group.
-
#groups_members(*args) ⇒ Object
GET /groups/id/members list of users who joined the group.
-
#groups_moderators(*args) ⇒ Object
GET /groups/id/moderators list of users who moderate the group.
-
#groups_tracks(*args) ⇒ Object
GET /groups/id/tracks list of contributed and approved tracks.
-
#groups_users(*args) ⇒ Object
GET /groups/id/users list of users who contributed to, joined or moderate the group.
-
#initialize(*args) ⇒ Groups
constructor
Initialize on the Soundcloud::Client class.
Methods inherited from Client
#method_missing, #playlists, #tracks, #users
Constructor Details
#initialize(*args) ⇒ Groups
Initialize on the Soundcloud::Client class
6 7 8 |
# File 'lib/soundcloud2/groups.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_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/soundcloud2/groups.rb', line 3 def api_key @api_key end |
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
3 4 5 |
# File 'lib/soundcloud2/groups.rb', line 3 def conn @conn end |
Instance Method Details
#groups(*args) ⇒ Object
GET /groups/id a group
11 12 13 14 15 |
# File 'lib/soundcloud2/groups.rb', line 11 def groups(*args) = args..merge(:client_id => api_key) response = conn.get("/groups/#{args[0]}.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |
#groups_contributors(*args) ⇒ Object
GET /groups/id/contributors list of users who contributed a track to the group
32 33 34 35 36 |
# File 'lib/soundcloud2/groups.rb', line 32 def groups_contributors(*args) = args..merge(:client_id => api_key) response = conn.get("/groups/#{args[0]}/contributors.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |
#groups_members(*args) ⇒ Object
GET /groups/id/members list of users who joined the group
25 26 27 28 29 |
# File 'lib/soundcloud2/groups.rb', line 25 def groups_members(*args) = args..merge(:client_id => api_key) response = conn.get("/groups/#{args[0]}/members.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |
#groups_moderators(*args) ⇒ Object
GET /groups/id/moderators list of users who moderate the group
18 19 20 21 22 |
# File 'lib/soundcloud2/groups.rb', line 18 def groups_moderators(*args) = args..merge(:client_id => api_key) response = conn.get("/groups/#{args[0]}/moderators.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |
#groups_tracks(*args) ⇒ Object
GET /groups/id/tracks list of contributed and approved tracks
46 47 48 49 50 |
# File 'lib/soundcloud2/groups.rb', line 46 def groups_tracks(*args) = args..merge(:client_id => api_key) response = conn.get("/groups/#{args[0]}/tracks.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |
#groups_users(*args) ⇒ Object
GET /groups/id/users list of users who contributed to, joined or moderate the group
39 40 41 42 43 |
# File 'lib/soundcloud2/groups.rb', line 39 def groups_users(*args) = args..merge(:client_id => api_key) response = conn.get("/groups/#{args[0]}/users.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |