Class: Jschematic::Attributes::Format::Ipv6

Inherits:
Object
  • Object
show all
Includes:
Element
Defined in:
lib/jschematic/attributes/format.rb

Instance Attribute Summary

Attributes included from Element

#id, #parent

Instance Method Summary collapse

Methods included from Element

#required?, #schema_for, #title, #to_s

Instance Method Details

#accepts?(addr) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
44
45
# File 'lib/jschematic/attributes/format.rb', line 41

def accepts?(addr)
  IPAddr.new(addr).ipv6?
rescue ArgumentError
  false
end