Class: Wifimap::Mac

Inherits:
Object
  • Object
show all
Defined in:
lib/wifimap/mac.rb

Class Method Summary collapse

Class Method Details

.manufacturer(mac) ⇒ Object

Get the manufacturer for the given mac address.



13
14
15
# File 'lib/wifimap/mac.rb', line 13

def self.manufacturer(mac)
  Louis.lookup(mac)['long_vendor']
end

.valid?(mac) ⇒ Boolean

Return true if the mac format is correct, false otherwise.

Returns:

  • (Boolean)


8
9
10
# File 'lib/wifimap/mac.rb', line 8

def self.valid?(mac)
  mac =~ /([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})/ ? true : false
end