def search(type, query)
      results = []
      search = request('getResultsFromSearch', type: type, query: query)
      results = search['result'].map do |data|
        next Song.new data if type == 'Songs'
        next Playlist.new(self, data) if type == 'Playlists'
        data
      end if search.key?('result')
      results
    end
def search(type, query)
      results = []
      search = request('getResultsFromSearch', type: type, query: query)
      results = search['result'].map do |data|
        next Song.new data if type == 'Songs'
        next Playlist.new(self, data) if type == 'Playlists'
        data
      end if search.key?('result')
      results
    end
Perform search request for query