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

Version Path
flapjack-0.6.39 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.38 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.37 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.36 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.35 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.34 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.33 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.32 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.31 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.30 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.29 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.28 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.27 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.26 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.25 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.24 lib/flapjack/persistence/data_mapper/models/node.rb
flapjack-0.6.23 lib/flapjack/persistence/data_mapper/models/node.rb