Sha256: c20cd162b9104cde68e3a1374b94e191d2222a7a3642470e2ebdc454a2b1ad5b
Contents?: true
Size: 358 Bytes
Versions: 17
Compression:
Stored size: 358 Bytes
Contents
#!/usr/bin/env ruby class Node include DataMapper::Resource has n, :checks property :fqdn, String, :key => true validates_is_unique :fqdn validates_format :fqdn, :with => /^[0-9|a-z|A-Z|\-|\.]*$/, :message => "not a RFC1035-formatted FQDN (see section 2.3.1)" def hostname self.fqdn.split('.').first end end
Version data entries
17 entries across 17 versions & 1 rubygems