Sha256: 83468620f7976b69678c7eb8baae9bb0872024c9fbc443cdcc82a1f36e2d05d2

Contents?: true

Size: 1.27 KB

Versions: 11

Compression:

Stored size: 1.27 KB

Contents

class TestLab

  # Network Error Class
  class NetworkError < TestLabError; end

  # Network Class
  #
  # @author Zachary Patten <zachary AT jovelabs DOT com>
  class Network < ZTK::DSL::Base
    STATUS_KEYS   = %w(id node_id state interface network netmask broadcast provisioners).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

    include TestLab::Utility::Misc

    # Associations and Attributes
    belongs_to  :node,          :class_name => 'TestLab::Node'
    has_many    :interfaces,    :class_name => 'TestLab::Interface'

    attribute   :provisioners,  :default => Array.new
    attribute   :config,        :default => Hash.new

    attribute   :address
    attribute   :bridge


    def initialize(*args)
      @ui     = TestLab.ui

      super(*args)

      @ui.logger.info { "Network '#{self.id}' Loaded" }
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
testlab-1.0.1 lib/testlab/network.rb
testlab-1.0.0 lib/testlab/network.rb
testlab-0.9.1 lib/testlab/network.rb
testlab-0.9.0 lib/testlab/network.rb
testlab-0.8.6 lib/testlab/network.rb
testlab-0.8.5 lib/testlab/network.rb
testlab-0.8.4 lib/testlab/network.rb
testlab-0.8.3 lib/testlab/network.rb
testlab-0.8.2 lib/testlab/network.rb
testlab-0.8.1 lib/testlab/network.rb
testlab-0.8.0 lib/testlab/network.rb