Sha256: e6f58c6d13f236946b8fca620b4d4bdef977d8e01b8f87996f2492eea8e714c7

Contents?: true

Size: 827 Bytes

Versions: 30

Compression:

Stored size: 827 Bytes

Contents

class TestLab

  # Interface Error Class
  class InterfaceError < TestLabError; end

  # Interface Class
  #
  # @author Zachary Patten <zachary AT jovelabs DOT com>
  class Interface < ZTK::DSL::Base

    # Associations and Attributes
    belongs_to  :container,  :class_name => 'TestLab::Container'
    belongs_to  :network,    :class_name => 'TestLab::Network'

    attribute   :address
    attribute   :mac
    attribute   :name

    attribute   :primary,    :default => false

    def initialize(*args)
      super(*args)

      @ui = TestLab.ui
    end

    def ip
      TestLab::Utility.ip(self.address)
    end

    def cidr
      TestLab::Utility.cidr(self.address)
    end

    def netmask
      TestLab::Utility.netmask(self.address)
    end

    def ptr
      TestLab::Utility.ptr(self.address)
    end

  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
testlab-0.6.15 lib/testlab/interface.rb
testlab-0.6.14 lib/testlab/interface.rb
testlab-0.6.12 lib/testlab/interface.rb
testlab-0.6.11 lib/testlab/interface.rb
testlab-0.6.10 lib/testlab/interface.rb
testlab-0.6.9 lib/testlab/interface.rb
testlab-0.6.8 lib/testlab/interface.rb
testlab-0.6.7 lib/testlab/interface.rb
testlab-0.6.6 lib/testlab/interface.rb
testlab-0.6.5 lib/testlab/interface.rb
testlab-0.6.4 lib/testlab/interface.rb
testlab-0.6.3 lib/testlab/interface.rb
testlab-0.6.2 lib/testlab/interface.rb
testlab-0.6.1 lib/testlab/interface.rb
testlab-0.6.0 lib/testlab/interface.rb
testlab-0.5.4 lib/testlab/interface.rb
testlab-0.5.3 lib/testlab/interface.rb
testlab-0.5.2 lib/testlab/interface.rb
testlab-0.5.1 lib/testlab/interface.rb
testlab-0.5.0 lib/testlab/interface.rb