Sha256: 09b03051800bc3803a2d19cc3c8e5b2fa27465f778b9e4ae836ce121e3816f2a

Contents?: true

Size: 616 Bytes

Versions: 2

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true
module PhoneSites
  module GsmArena
    class Connection
      def self.get_manufacturers
        Manufacturer.all
      end

      def self.get_models(manufacturer)
        manufacturer.models
      end

      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

      def self.search(name)
        SearchResponse.new.perform(name)
      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/connection.rb
phone_sites-0.1.1 lib/phone_sites/gsm_arena/connection.rb