Class: Wifimap::Mac
- Inherits:
-
Object
- Object
- Wifimap::Mac
- Defined in:
- lib/wifimap/mac.rb
Class Method Summary collapse
-
.manufacturer(mac) ⇒ Object
Get the manufacturer for the given mac address.
-
.valid?(mac) ⇒ Boolean
Return true if the mac format is correct, false otherwise.
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.
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 |