Class: Soundcloud2::Comments

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Client

#groups, #method_missing, #playlists, #tracks, #users

Constructor Details

#initialize(*args) ⇒ Comments

Initialize on the Soundcloud::Client class



6
7
8
# File 'lib/soundcloud2/comments.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/comments.rb', line 3

def api_key
  @api_key
end

#connObject (readonly)

Returns the value of attribute conn.



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

def conn
  @conn
end

Instance Method Details

#comments(*args) ⇒ Object

GET /comments/id a group



11
12
13
14
15
# File 'lib/soundcloud2/comments.rb', line 11

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