module BillHicks class BrandConverter def self.convert(value) if brand = self.brands.detect { |brand| brand[:prefix] == value.split[0].upcase } brand[:company].empty? ? value.split[0] : brand[:company] else value.split[0].upcase end end def self.brands @@brands ||= [ { prefix: '2A', company: '2A Armament' }, { prefix: 'AAE', company: 'AA&E' }, { prefix: 'ADAMS', company: 'Adams Arms' }, { prefix: 'AAC', company: 'Advanced Armament' }, { prefix: 'AT', company: 'Advanced Technology, Inc.' }, { prefix: 'AMK', company: 'Adventure Medic' }, { prefix: 'AGU', company: 'Texas Armament & Technology' }, { prefix: 'AS', company: 'Aimshot' }, { prefix: 'AIM', company: 'Aimtech Mount Systems' }, { prefix: 'APF', company: 'Alex Pro Firearms' }, { prefix: 'KIT', company: 'Alex Pro Firearms' }, { prefix: 'ALLEN', company: 'Allen' }, { prefix: 'ATI', company: 'American Tactical Imports' }, { prefix: 'AM', company: 'Anderson Manufacturing' }, { prefix: 'ARMA', company: 'Armalite' }, { prefix: 'APO', company: 'Arrow Precision' }, { prefix: 'ARS', company: 'Arsenal' }, { prefix: 'ATN', company: 'ATN' }, { prefix: 'AO', company: 'Auto Ordnance' }, { prefix: 'BAR', company: 'Barnes Bullets' }, { prefix: 'BARN', company: 'Barnett Crossbows' }, { prefix: 'BARR', company: 'Barrett Firearms Mfg Inc' }, { prefix: 'BARS', company: 'Barska' }, { prefix: 'BARSKA', company: 'Barska' }, { prefix: 'BOG', company: 'Battenfeld' }, { prefix: 'CW', company: 'Battenfeld' }, { prefix: 'FRANK', company: 'Battenfeld' }, { prefix: 'HOOY', company: 'Battenfeld' }, { prefix: 'LD', company: 'Battenfeld' }, { prefix: 'TIP', company: 'Battenfeld' }, { prefix: 'WH', company: 'Battenfeld' }, { prefix: 'BXB', company: 'Bear Archery' }, { prefix: 'BER', company: 'Beretta USA' }, { prefix: 'BM', company: 'Berry\'s Manufacturing' }, { prefix: 'BC', company: 'Birchwood Laboratories, Inc.' }, { prefix: 'SL', company: 'Birchwood Laboratories, Inc.' }, { prefix: 'BR', company: 'Black Rain Ordnance, Inc.' }, { prefix: 'BH', company: 'Blackhawk' }, { prefix: 'KNOXX', company: 'Blackhawk' }, { prefix: 'BB', company: 'Blue Book Publications' }, { prefix: 'BOB', company: 'Boberg Arms Corporation' }, { prefix: 'BOND', company: 'Bond Arms' }, { prefix: 'BRO', company: 'Browning' }, { prefix: 'BSA', company: 'BSA' }, { prefix: 'BUCK', company: 'Buck Knives Inc' }, { prefix: 'BD', company: 'Bulldog Cases' }, { prefix: 'BUR', company: 'Burris' }, { prefix: 'BF', company: 'Bushmaster' }, { prefix: 'BUS', company: 'Bushnell Inc.' }, { prefix: 'MILLET', company: 'Bushnell Inc.' }, { prefix: 'RUB', company: 'Bushnell Inc.' }, { prefix: 'SIM', company: 'Bushnell Inc.' }, { prefix: 'TAS', company: 'Bushnell Inc.' }, { prefix: 'BS', company: 'Bushnell Inc.' }, { prefix: 'BUT', company: 'Bushnell Inc.' }, { prefix: 'GM', company: 'Bushnell Inc.' }, { prefix: 'HOP', company: 'Bushnell Inc.' }, { prefix: 'SP', company: 'Bushnell Inc.' }, { prefix: 'UM', company: 'Bushnell Inc.' }, { prefix: 'CPD', company: 'C Products Defense' }, { prefix: 'CAA', company: 'CAA' }, { prefix: 'C4F', company: 'Call4Fire' }, { prefix: 'CE', company: 'Carbon Express' }, { prefix: 'CDLY', company: 'Charles Daly' }, { prefix: 'CARL', company: 'Carlson\'s' }, { prefix: 'CP', company: 'Center Point' }, { prefix: 'CA', company: 'Charter Arms' }, { prefix: 'CF', company: 'Chiappa Firearms' }, { prefix: 'CIM', company: 'Cimarron' }, { prefix: 'CFA', company: 'Civilian Force Arms' }, { prefix: 'CMC', company: 'CMC' }, { prefix: 'CMMG', company: 'CMMG' }, { prefix: 'COBRA', company: 'Cobra' }, { prefix: 'CLT', company: 'Colt\'s Manufacturing' }, { prefix: 'TALO CLT',company: 'Colt\'s Manufacturing' }, { prefix: 'CR', company: 'Bold Ideas/Colt Competition' }, { prefix: 'COR', company: 'Corbon Ammo' }, { prefix: 'GLASER', company: 'Corbon Ammo' }, { prefix: 'C15', company: 'Good Time Outdoors Inc' }, { prefix: 'COV', company: 'Covert' }, { prefix: 'KSA', company: 'Keystone Sporting Arms' }, { prefix: 'CTC', company: 'Crimson Trace Corporation' }, { prefix: 'BEN', company: 'Crosman Corporation' }, { prefix: 'CROS', company: 'Crosman Corporation' }, { prefix: 'NT', company: 'Non Typical (Cuddeback)' }, { prefix: 'BERG', company: 'CVA' }, { prefix: 'BGA', company: 'CVA' }, { prefix: 'CVA', company: 'CVA' }, { prefix: 'QUA', company: 'CVA' }, { prefix: 'CZ', company: 'Cz Usa' }, { prefix: 'DAISY', company: 'Daisy Outdoor Products' }, { prefix: 'DDI', company: 'Destructive Devices Industries' }, { prefix: 'DAIR', company: 'Dead Air' }, { prefix: 'DTI', company: 'Del-Ton' }, { prefix: 'DES', company: 'Desantis' }, { prefix: 'DBF', company: 'Diamondback' }, { prefix: 'DH', company: 'Diamondhead USA' }, { prefix: 'DA', company: 'Dickinson' }, { prefix: 'BEAR', company: 'DKG Trading Inc.' }, { prefix: 'CENT', company: 'DKG Trading Inc.' }, { prefix: 'DKG', company: 'DKG Trading Inc.' }, { prefix: 'FM', company: 'DKG Trading Inc.' }, { prefix: 'NS', company: 'DKG Trading Inc.' }, { prefix: 'DAT', company: 'Do-All Outdoors' }, { prefix: 'DOG', company: 'Dogtra Company' }, { prefix: 'DSC', company: 'Doublestar Corporation' }, { prefix: 'DTD', company: 'Doubletap Defense' }, { prefix: 'DPMS', company: 'Dpms Firearms' }, { prefix: 'DRA', company: 'Drago Gear' }, { prefix: 'DSA', company: 'DSA, Inc.' }, { prefix: 'DT', company: 'DT Systems, Inc.' }, { prefix: 'EAA', company: 'EAA' }, { prefix: 'EI', company: 'Eagle Imports' }, { prefix: 'EOT', company: 'EO Tech' }, { prefix: 'ERGO', company: 'Falcon Industries Inc' }, { prefix: 'EST', company: 'Federal Ammo' }, { prefix: 'FED', company: 'Federal Ammo' }, { prefix: 'IND', company: 'Federal Ammo' }, { prefix: 'FIO', company: 'Fiocchi' }, { prefix: 'WILL', company: 'Williams Gun Sight Company' }, { prefix: 'FC', company: 'Flippin Critters' }, { prefix: 'FLITZ', company: 'Flitz' }, { prefix: 'FMK', company: 'FMK' }, { prefix: 'FNH', company: 'FN' }, { prefix: 'FOBUS', company: 'First Samco/Fobus Holster' }, { prefix: 'FA', company: 'Franklin Armory' }, { prefix: 'G2R', company: 'G2 Research, Inc' }, { prefix: 'G96', company: 'G96 Products Co Inc.' }, { prefix: 'GAL', company: 'Galco Gunleather' }, { prefix: 'GAMO', company: 'Gamo Outdoor Usa' }, { prefix: 'GATCO', company: 'Gatco' }, { prefix: 'TIMB', company: 'Gatco' }, { prefix: 'GEM', company: 'Gemtech' }, { prefix: 'GERBER', company: 'Gerber' }, { prefix: 'GMG', company: 'Global Military Gear' }, { prefix: 'GLOCK', company: 'Glock' }, { prefix: 'MISC', company: 'Glock' }, { prefix: 'GOAL', company: 'Goal Zero, Llc' }, { prefix: 'GRAB', company: 'Grabber Inc' }, { prefix: 'GRIF', company: 'Griffin' }, { prefix: 'GT', company: 'Grovtec' }, { prefix: 'CYC', company: 'GSM' }, { prefix: 'STC', company: 'GSM' }, { prefix: 'WALK', company: 'GSM' }, { prefix: 'WRC', company: 'GSM' }, { prefix: 'GV', company: 'Gunvault' }, { prefix: 'HK', company: 'Heckler & Koch, Inc.' }, { prefix: 'NEF', company: 'H&R' }, { prefix: 'HAR', company: 'Harris' }, { prefix: 'HWK', company: 'Hawke Sport Optics' }, { prefix: 'HC', company: 'HC Mags' }, { prefix: 'HD', company: 'Heizer' }, { prefix: 'HRAC', company: 'Henry Repeating Arms' }, { prefix: 'HRACW', company: 'Henry Wisconsin Llc' }, { prefix: 'HTG', company: 'Heritage Manufacturing, Inc.' }, { prefix: 'HEX', company: 'Hexmag' }, { prefix: 'MKS', company: 'Hi Point' }, { prefix: 'HIVIZ', company: 'North Pass Ltd (Hiviz)' }, { prefix: 'HKS', company: 'Hks Products' }, { prefix: 'HOG', company: 'Hogue Grips' }, { prefix: 'HOLO', company: 'Holosun' }, { prefix: 'HDEF', company: 'Honor Defense' }, { prefix: 'HOOY', company: 'Hooyman' }, { prefix: 'HORN', company: 'Hornady' }, { prefix: 'HL', company: 'Howard Leight' }, { prefix: 'HPR', company: 'Hpr Ammunition' }, { prefix: 'HSPI', company: 'HS Precision' }, { prefix: 'HUN', company: 'Hunter Company' }, { prefix: 'HSP', company: 'Hunters Specialties' }, { prefix: 'JS', company: 'Hunters Specialties' }, { prefix: 'HSM', company: 'Hunting Shack Inc.' }, { prefix: 'HUSK', company: 'Huskemaw Optics' }, { prefix: 'IFG', company: 'IFG' }, { prefix: 'IO', company: 'Inter Ordnance' }, { prefix: 'IAC', company: 'Interstate Arms' }, { prefix: 'ITS', company: 'Intrepid Tactical' }, { prefix: 'IOSSO', company: 'Iosso Products' }, { prefix: 'HOLDEN', company: 'Ironsighter' }, { prefix: 'ITH', company: 'Ithaca Gun Company' }, { prefix: 'IWI', company: 'IWI US' }, { prefix: 'JBA', company: 'Captech International' }, { prefix: 'JRC', company: 'LDB Supply' }, { prefix: 'KA', company: 'Kahr Arms' }, { prefix: 'KEL', company: 'Kel-Tec' }, { prefix: 'KER', company: 'Kershaw Knives' }, { prefix: 'KING', company: 'Kingston Armory' }, { prefix: 'KON', company: 'Konus' }, { prefix: 'KRISS', company: 'Kriss USA' }, { prefix: 'LN', company: 'Lancer' }, { prefix: 'LS', company: 'Lansky' }, { prefix: 'LANTAC', company: 'Lantac Usa Llc' }, { prefix: 'LG', company: 'Laser Genetics' }, { prefix: 'LL', company: 'Laserlyte' }, { prefix: 'LM', company: 'Lasermax' }, { prefix: 'UTG', company: 'Leapers, Inc.' }, { prefix: 'LEE', company: 'Lee Precision Inc' }, { prefix: 'ISSC', company: 'Legacy Sports International' }, { prefix: 'LSI', company: 'Legacy Sports International' }, { prefix: 'LEU', company: 'Leupold' }, { prefix: 'RED', company: 'Leupold' }, { prefix: 'LIB', company: 'Liberty Ammunition' }, { prefix: 'LAI', company: 'Liberty Arms International' }, { prefix: 'LF', company: 'Lightfield' }, { prefix: 'LH', company: 'Lionheart' }, { prefix: 'LWRC', company: 'LWRC' }, { prefix: 'ADTAC', company: 'Lyman' }, { prefix: 'AZOOM', company: 'Lyman' }, { prefix: 'LYM', company: 'Lyman' }, { prefix: 'PAC', company: 'Lyman' }, { prefix: 'TAC', company: 'Lyman' }, { prefix: 'TRIUS', company: 'Lyman' }, { prefix: 'MM', company: 'M&M Firearms' }, { prefix: 'MACE', company: 'Mace Personal Defense' }, { prefix: 'LULA', company: 'Maglula' }, { prefix: 'MR', company: 'Magnum Research' }, { prefix: 'MTA', company: 'MagTech' }, { prefix: 'SB', company: 'MagTech' }, { prefix: 'MAKO', company: 'Mako' }, { prefix: 'MANTA', company: 'Manta' }, { prefix: 'MAR', company: 'Marlin Firearms' }, { prefix: 'ML', company: 'Master Lock' }, { prefix: 'MPA', company: 'Masterpiece Arms' }, { prefix: 'MEC', company: 'Mayville Engineering (Mec)' }, { prefix: 'MECGAR', company: 'Mec Gar Usa, Inc.' }, { prefix: 'MGI', company: 'MG Industries' }, { prefix: 'MI', company: 'Midwest Industries' }, { prefix: 'MNX', company: 'Minox' }, { prefix: 'MFT', company: 'Mission First Tactical' }, { prefix: 'MK', company: 'Moisture King' }, { prefix: 'FIME', company: 'Fime Group' }, { prefix: 'MAV', company: 'Mossberg' }, { prefix: 'MOSS', company: 'Mossberg' }, { prefix: 'MOUL', company: 'Moultrie' }, { prefix: 'MTM', company: 'Mtm' }, { prefix: 'NIKKO', company: 'Nikko' }, { prefix: 'NIK', company: 'Nikon' }, { prefix: 'NORD', company: 'Nordic Components' }, { prefix: 'NOREEN', company: 'Noreen Firearms' }, { prefix: 'NAA', company: 'North American Arms' }, { prefix: 'NOS', company: 'Nosler' }, { prefix: 'SSA', company: 'Nosler' }, { prefix: 'OEM', company: 'OEM' }, { prefix: 'OAI', company: 'Olympic Arms' }, { prefix: 'OSS', company: 'Operators Suppressor Systems' }, { prefix: 'OTIS', company: 'Otis Technology, Inc.' }, { prefix: 'OBF', company: 'Outback Flashlights' }, { prefix: 'OC', company: 'Outdoor Connection' }, { prefix: 'OZON', company: 'Ozonics' }, { prefix: 'PAL', company: 'Palco Sports' }, { prefix: 'PO', company: 'Para Usa' }, { prefix: 'POF', company: 'Patriot Ordnance Factory' }, { prefix: 'PEARCE', company: 'Pearce Grip, Inc' }, { prefix: 'PELICAN', company: 'Pelican' }, { prefix: 'PEL', company: '3M Peltor' }, { prefix: 'PR', company: 'Pete Rickard Inc' }, { prefix: 'PT', company: 'Phoenix Technology Ltd.' }, { prefix: 'PLANO', company: 'Plano Molding Co.' }, { prefix: 'PMC', company: 'PMC' }, { prefix: 'PRED', company: 'Predator Tactics' }, { prefix: 'PRIMOS', company: 'Bushnell Inc.' }, { prefix: 'PE', company: 'Pro Ears' }, { prefix: 'PM', company: 'Pro Mag' }, { prefix: 'PRO', company: 'Pro Shot' }, { prefix: 'PTAC', company: 'PTAC Usa' }, { prefix: 'PTR', company: 'PTR Industries' }, { prefix: 'PYRA', company: 'Pyramex Safety Products' }, { prefix: 'RAD', company: 'Radians' }, { prefix: 'REAL', company: 'Real Avid' }, { prefix: 'RWB', company: 'Red, White & Blue, Llc' }, { prefix: 'REM', company: 'Remington' }, { prefix: 'RG', company: 'Rguns' }, { prefix: 'ROB', company: 'Roberts Defense' }, { prefix: 'AUA', company: 'Armscor Precision Internationa' }, { prefix: 'RIA', company: 'Armscor Precision Internationa' }, { prefix: 'RRA', company: 'Rock River Arms' }, { prefix: 'ROG', company: 'Rogers Holster Company' }, { prefix: 'ROS', company: 'Rossi' }, { prefix: 'RUG', company: 'Ruger' }, { prefix: 'TPD', company: 'Tornado Personal Defense' }, { prefix: 'RS', company: 'Rugged Supressors' }, { prefix: 'RAA', company: 'Icon Marketing Group' }, { prefix: 'RWC', company: 'Transportation Alliance Bank' }, { prefix: 'SAB', company: 'Sabre Defense' }, { prefix: 'SACK', company: 'Sack Ups' }, { prefix: 'BIA', company: 'Safariland' }, { prefix: 'BREAK', company: 'Safariland' }, { prefix: 'BSQ', company: 'Safariland' }, { prefix: 'KB', company: 'Safariland' }, { prefix: 'SAF', company: 'Safariland' }, { prefix: 'SAGEN', company: 'Sagen Inc.' }, { prefix: 'SAV', company: 'Savage Arms, Inc.' }, { prefix: 'SCCY', company: 'SCCY Industries' }, { prefix: 'SC', company: 'Shooters Choice' }, { prefix: 'SIE', company: 'Sierra' }, { prefix: 'SIG', company: 'Sig Sauer' }, { prefix: 'FF', company: 'Sightmark' }, { prefix: 'PULSAR', company: 'Sightmark' }, { prefix: 'SM', company: 'Sightmark' }, { prefix: 'ST', company: 'Sightron' }, { prefix: 'S9', company: 'Signal 9 Defense' }, { prefix: 'SIL', company: 'Silencerco' }, { prefix: 'SIMS', company: 'Sims Vibration Lab (Limb Sav)' }, { prefix: 'SFS', company: 'Slide Fire Solutions' }, { prefix: 'SW', company: 'Smith & Wesson' }, { prefix: 'SOG', company: 'SOG' }, { prefix: 'SONIC', company: 'Sonic Boom Exploding Targets' }, { prefix: 'SBLOOM', company: 'Southern Bloomer' }, { prefix: 'SPR', company: 'Springfield Armory' }, { prefix: 'SO', company: 'Stack On Products' }, { prefix: 'SML', company: 'Standard Manufacturing Co' }, { prefix: 'STOP', company: 'Phalanx Defense Systems' }, { prefix: 'STEYR', company: 'Steyr Arms' }, { prefix: 'STORM', company: 'Pelican Storm Cases' }, { prefix: 'STREAM', company: 'Streamlight' }, { prefix: 'SUN', company: 'Sun Optics' }, { prefix: 'SF', company: 'Surefire' }, { prefix: 'SWIFT', company: 'Swift Bullet Company' }, { prefix: 'TANN', company: 'Tannerite' }, { prefix: 'TAPCO', company: 'Tapco' }, { prefix: 'TAFA', company: 'Target Factory' }, { prefix: 'TAU', company: 'Taurus International Mfg' }, { prefix: 'SCHRADE', company: 'Taylor Brands Llc' }, { prefix: 'TAY', company: 'Taylor Brands Llc' }, { prefix: 'TF', company: 'Taylor\'s & Company, Inc.' }, { prefix: 'TC', company: 'Thompson Center' }, { prefix: 'TCLIP', company: 'Techna Clip' }, { prefix: 'TGM', company: 'Technical Grinding and Machining' }, { prefix: 'HORT', company: 'Tenpoint Crossbow Technologies' }, { prefix: 'TP', company: 'Tenpoint Crossbow Technologies' }, { prefix: 'SAKO', company: 'Tikka' }, { prefix: 'TIK', company: 'Tikka' }, { prefix: 'TINKS', company: 'Tinks' }, { prefix: 'TRAD', company: 'Traditions Muzzleloading' }, { prefix: 'TRI', company: 'Trijicon' }, { prefix: 'TRIMAG', company: 'Alangator' }, { prefix: 'TSA', company: 'Tristar' }, { prefix: 'TROY', company: 'Troy' }, { prefix: 'TG', company: 'Truglo' }, { prefix: 'MAXX', company: 'Tulammo' }, { prefix: 'TA', company: 'Tulammo' }, { prefix: 'TIF', company: 'Buds Gun Shop' }, { prefix: 'UD', company: 'Ultradot Distribution' }, { prefix: 'UMAX', company: 'Ultramax Ammunition' }, { prefix: 'UMAREX', company: 'Umarex' }, { prefix: 'USFA', company: 'USFA/Zipfactory' }, { prefix: 'USPK', company: 'US Peacekeeper' }, { prefix: 'USSG', company: 'USSG Inc.' }, { prefix: 'UTAS', company: 'UTAS' }, { prefix: 'VV', company: 'Vero Vellini' }, { prefix: 'VC', company: 'Versacarry' }, { prefix: 'LAS', company: 'Viridian' }, { prefix: 'BCMM', company: 'Vista Outdoor' }, { prefix: 'CCI', company: 'Vista Outdoor' }, { prefix: 'CHAMP', company: 'Vista Outdoor' }, { prefix: 'GUNS', company: 'Vista Outdoor' }, { prefix: 'OUTERS', company: 'Vista Outdoor' }, { prefix: 'RAM', company: 'Vista Outdoor' }, { prefix: 'RCBS', company: 'Vista Outdoor' }, { prefix: 'SHOOT', company: 'Vista Outdoor' }, { prefix: 'SPEER', company: 'Vista Outdoor' }, { prefix: 'WAL', company: 'Walther Arms' }, { prefix: 'WAR', company: 'Warne' }, { prefix: 'WASP', company: 'Waspcam' }, { prefix: 'WBY', company: 'Weatherby' }, { prefix: 'WEAVER', company: 'Weaver' }, { prefix: 'WR', company: 'Wildlife Research' }, { prefix: 'WIN', company: 'Winchester' }, { prefix: 'WW', company: 'Windham Weaponry' }, { prefix: 'WISE', company: 'Wise Foods' }, { prefix: 'WMD', company: 'WMD Guns' }, { prefix: 'WDY', company: 'Inventive Design Studio Llc' }, { prefix: 'XP', company: 'X Products' }, { prefix: 'YHM', company: 'Yankee Hill Machine Co., Inc.' }, { prefix: 'ZS', company: 'Zeiss' }, { prefix: 'ZEN', company: 'Zenith Firearms' }, { prefix: 'TALO DBF', company: 'Diamondback' }, { prefix: 'TALO GLOCK', company: 'Glock' }, { prefix: 'TALO HRAC', company: 'Henry Repeating Arms' }, { prefix: 'TALO MOSS', company: 'Mossberg' }, { prefix: 'TALO NAA', company: 'North American Arms' }, { prefix: 'TALO RUG', company: 'Ruger' }, { prefix: 'TALO SIG', company: 'Sig Sauer' }, { prefix: 'TALO SW', company: 'Smith & Wesson' }, { prefix: 'TALO WAL', company: 'Walther Arms' } ] end end end