Module: TestLab::Container::Interface

Included in:
TestLab::Container
Defined in:
lib/testlab/container/interface.rb

Instance Method Summary collapse

Instance Method Details

#primary_interfaceTestLab::Interface

Container primary interface

Returns the primary interface for the container. If the container has multiple interfaces, this is based on which ever interface is marked with the primary flag. If the container only has one interface, then it is returned.

Returns:



14
15
16
17
18
19
20
# File 'lib/testlab/container/interface.rb', line 14

def primary_interface
  if self.interfaces.any?{ |i| i.primary == true }
    self.interfaces.find{ |i| i.primary == true }
  else
    self.interfaces.first
  end
end