Method: RSpotify::Category.find
- Defined in:
- lib/rspotify/category.rb
.find(id, **options) ⇒ Category
Returns Category object with id provided
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rspotify/category.rb', line 23 def self.find(id, **) url = "browse/categories/#{id}" url << '?' if .any? .each_with_index do |option, index| url << "#{option[0]}=#{option[1]}" url << '&' unless index == .size-1 end response = RSpotify.get(url) return response if RSpotify.raw_response Category.new response end |