Class: String

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

Instance Method Summary collapse

Instance Method Details

#to_macObject



37
38
39
# File 'lib/mac_address.rb', line 37

def to_mac
  MacAddress.new(self).to_s
end

#valid_mac?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
44
45
46
47
# File 'lib/mac_address.rb', line 41

def valid_mac?(options = {})
  if options[:strict]
    MacAddress.validate_strict(self)
  else
    MacAddress.validate(self)
  end
end