Class: Lastfm::MethodCategory
- Inherits:
-
Object
- Object
- Lastfm::MethodCategory
- Defined in:
- lib/lastfm/method_category.rb
Instance Method Summary collapse
-
#initialize(lastfm) ⇒ MethodCategory
constructor
A new instance of MethodCategory.
- #request(*args) ⇒ Object
- #request_for_authentication(method, params = {}) ⇒ Object
- #request_with_authentication(method, params = {}) ⇒ Object
- #write_request(method, params = {}) ⇒ Object
Constructor Details
#initialize(lastfm) ⇒ MethodCategory
Returns a new instance of MethodCategory.
3 4 5 |
# File 'lib/lastfm/method_category.rb', line 3 def initialize(lastfm) @lastfm = lastfm end |
Instance Method Details
#request(*args) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/lastfm/method_category.rb', line 19 def request(*args) method, *rest = args method = [self.class.name.split(/::/).last.downcase, method].join('.') @lastfm.request(method, *rest) end |
#request_for_authentication(method, params = {}) ⇒ Object
15 16 17 |
# File 'lib/lastfm/method_category.rb', line 15 def request_for_authentication(method, params = {}) request(method, params, :get, true) end |
#request_with_authentication(method, params = {}) ⇒ Object
11 12 13 |
# File 'lib/lastfm/method_category.rb', line 11 def request_with_authentication(method, params = {}) request(method, params, :get, true, true) end |
#write_request(method, params = {}) ⇒ Object
7 8 9 |
# File 'lib/lastfm/method_category.rb', line 7 def write_request(method, params = {}) request(method, params, :post, true, true) end |