Class: Wifimap::Mac
- Inherits:
-
Object
- Object
- Wifimap::Mac
- Defined in:
- lib/wifimap/mac.rb
Class Method Summary collapse
-
.manufacturer(mac) ⇒ String
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) ⇒ String
Get the manufacturer for the given mac address.
19 20 21 |
# File 'lib/wifimap/mac.rb', line 19 def self.manufacturer(mac) Louis.lookup(mac)['long_vendor'] end |
.valid?(mac) ⇒ Boolean
Return true if the mac format is correct, false otherwise.
11 12 13 |
# File 'lib/wifimap/mac.rb', line 11 def self.valid?(mac) mac =~ /([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})/ ? true : false end |