Class: PhoneSites::GsmArena::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/phone_sites/gsm_arena/connection.rb

Class Method Summary collapse

Class Method Details

.get_description(arg) ⇒ Object


13
14
15
16
17
18
19
20
21
22
# File 'lib/phone_sites/gsm_arena/connection.rb', line 13

def self.get_description(arg)
  case arg
  when PhoneModel
    arg.info
  when String
    ModelInfoResponse.new.perform(URI.join(PhoneSites::GsmArena::BASE_URL, arg).to_s)
  else
    raise NotImplementedException
  end
end

.get_manufacturersObject


5
6
7
# File 'lib/phone_sites/gsm_arena/connection.rb', line 5

def self.get_manufacturers
  Manufacturer.all
end

.get_models(manufacturer) ⇒ Object


9
10
11
# File 'lib/phone_sites/gsm_arena/connection.rb', line 9

def self.get_models(manufacturer)
  manufacturer.models
end

.search(name) ⇒ Object


24
25
26
# File 'lib/phone_sites/gsm_arena/connection.rb', line 24

def self.search(name)
  SearchResponse.new.perform(name)
end