Class: Soundcloud2::Comments
- Defined in:
- lib/soundcloud2/comments.rb
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
-
#comments(*args) ⇒ Object
GET /comments/id a group.
-
#initialize(*args) ⇒ Comments
constructor
Initialize on the Soundcloud::Client class.
- #method_missing(sym, *args, &block) ⇒ Object
Methods inherited from Client
#groups, #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
#method_missing(sym, *args, &block) ⇒ Object
15 16 17 18 19 |
# File 'lib/soundcloud2/comments.rb', line 15 def method_missing(sym, *args, &block) = args..merge(:client_id => api_key) response = conn.get("/#{sym.to_s}/#{args[0]}.json") { |req| req.params = } args.nil? ? response.body.send(sym) : response.body end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/soundcloud2/comments.rb', line 3 def api_key @api_key end |
#conn ⇒ Object (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 |
# File 'lib/soundcloud2/comments.rb', line 11 def comments(*args) super end |