class PhoneSites::GsmArena::PhoneModel

Constants

ITEMS_PER_PAGE

Public Instance Methods

info() click to toggle source
# File lib/phone_sites/gsm_arena/phone_model.rb, line 26
def info
  ModelInfoResponse.new.perform(URI.join(PhoneSites::GsmArena::BASE_URL, url).to_s)
end
parse(data, attr_name) click to toggle source
# File lib/phone_sites/gsm_arena/phone_model.rb, line 11
def parse(data, attr_name)
  case attr_name
  when :name
    data.children.last.text
  when :url
    data.attribute("href").text
  when :picture_url
    data.css("img").attribute("src").text
  when :description
    data.css("img").attribute("title").text
  else
    raise NotImplementedError
  end
end