Class: PhoneSites::GsmArena::SearchResponse

Inherits:
BaseResponse show all
Defined in:
lib/phone_sites/gsm_arena/search_response.rb

Instance Method Summary collapse

Instance Method Details

#perform(name, method = 'get', options = {}) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/phone_sites/gsm_arena/search_response.rb', line 5

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