Sha256: e45c2a7529bfc522fa73fbeeae8d7c36fc82709d4a03b7c8a56d7b15a12b4a05

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

require 'apple_models/version'

module AppleModels
  @@catalog = {
      'AppleTV1,1'  => 'Apple TV 1',
      'AppleTV2,1'  => 'Apple TV 2',
      'AppleTV3,1'  => 'Apple TV 3',
      'AppleTV3,2'  => 'Apple TV 3',
      'iPhone1,1'   => 'iPhone 2G',
      'iPhone1,2'   => 'iPhone 3G',
      'iPhone2,1'   => 'iPhone 3GS',
      'iPhone3,1'   => 'iPhone 4',
      'iPhone3,2'   => 'iPhone 4',      # CDMA Prototype
      'iPhone3,3'   => 'iPhone 4',      # CDMA
      'iPhone4,1'   => 'iPhone 4S',
      'iPhone5,1'   => 'iPhone 5',
      'iPhone5,2'   => 'iPhone 5',
      'iProd0,1'    => 'iPad',          # Prototype
      'iPad1,1'     => 'iPad',          # WiFi and WiFi + Cellular models use same product code
      'iPad2,1'     => 'iPad 2',        # WiFi
      'iPad2,2'     => 'iPad 2',        # WiFi + Cellular, GSM
      'iPad2,3'     => 'iPad 2',        # WiFi + Cellular, CDMA
      'iPad2,4'     => 'iPad 2',        # WiFi, unannounced internal chipset change of iPad2,1
      'iPad2,5'     => 'iPad Mini',     # WiFi
      'iPad2,6'     => 'iPad Mini',     # WiFi + Cellular
      'iPad2,7'     => 'iPad Mini',     # WiFi + Cellular, Verizon
      'iPad3,1'     => 'iPad 3',
      'iPad3,2'     => 'iPad 3',        # WiFi + Cellular, AT&T
      'iPad3,3'     => 'iPad 3',        # WiFi + Cellular, Verizon
      'iPad3,4'     => 'iPad 4',        # WiFi
      'iPad3,5'     => 'iPad 4',        # WiFi + Cellular, AT&T
      'iPad3,6'     => 'iPad 4',        # WiFi + Cellular, Verizon & Sprint
      'iPod1,1'     => 'iPod Touch 1G',
      'iPod2,1'     => 'iPod Touch 2G',
      'iPod2,2'     => 'iPod Touch 3G', # Prototype
      'iPod3,1'     => 'iPod Touch 3G',
      'iPod4,1'     => 'iPod Touch 4G',
      'iPod5,1'     => 'iPod Touch 5G'
    }
    
  def self.find(product_id)
    @@catalog[product_id]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
apple_models-1.0.2 lib/apple_models.rb
apple_models-1.0.1 lib/apple_models.rb