class Company def initialize() @oui = File.readlines("oui.txt").select{|l| l=~/\(hex\)/} @oui = @oui.map{|l| l.gsub(/^(..)-(..)-(..)\s+\(hex\)\s+(.*)/,"\\1:\\2:\\3\t\\4").chomp.split("\t")}.to_h # p @oui end def get_company(mac) return @oui[mac[0...8]] end end if __FILE__==$0 c = Company.new end