Sha256: 27740e18d50706141584fda4dfb1bd0a5f4eda42233228b56b35a285b87998e8

Contents?: true

Size: 482 Bytes

Versions: 2

Compression:

Stored size: 482 Bytes

Contents

# frozen_string_literal: true
module PhoneSites
  module GsmArena
    class SearchResponse < ::PhoneSites::BaseResponse
      def perform(name, method = 'get', options = {})
        url = "http://www.gsmarena.com/results.php3?sQuickSearch=yes&sName=" + URI.encode(name)
        response = super(url, method, options)
        Nokogiri::HTML(response.body).css('.makers li a').map do |elem|
          PhoneSites::GsmArena::PhoneModel.new(elem)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phone_sites-0.1.2 lib/phone_sites/gsm_arena/search_response.rb
phone_sites-0.1.1 lib/phone_sites/gsm_arena/search_response.rb