lib/testlab/network.rb in testlab-0.0.4 vs lib/testlab/network.rb in testlab-0.1.0
- old
+ new
@@ -5,27 +5,33 @@
# Network Class
#
# @author Zachary Patten <zachary@jovelabs.net>
class Network < ZTK::DSL::Base
- STATUS_KEYS = %w(node_id id state interface).map(&:to_sym)
+ STATUS_KEYS = %w(node_id id state interface network netmask broadcast).map(&:to_sym)
+ # Sub-Modules
+ autoload :Actions, 'testlab/network/actions'
+ autoload :Bind, 'testlab/network/bind'
+ autoload :ClassMethods, 'testlab/network/class_methods'
+ autoload :Lifecycle, 'testlab/network/lifecycle'
+ autoload :Status, 'testlab/network/status'
+
+ include TestLab::Network::Actions
+ include TestLab::Network::Bind
+ include TestLab::Network::Lifecycle
+ include TestLab::Network::Status
+
+ extend TestLab::Network::ClassMethods
+
+ # Associations and Attributes
belongs_to :node, :class_name => 'TestLab::Node'
attribute :bridge
attribute :ip
attribute :config
- autoload :Actions, 'testlab/network/actions'
- autoload :CIDR, 'testlab/network/cidr'
- autoload :Lifecycle, 'testlab/network/lifecycle'
- autoload :Status, 'testlab/network/status'
-
- include TestLab::Network::Actions
- include TestLab::Network::CIDR
- include TestLab::Network::Lifecycle
- include TestLab::Network::Status
def initialize(*args)
super(*args)
@ui = TestLab.ui