module TestLab::Container::Interface

Public Instance Methods

primary_interface() click to toggle source

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.

@return [TestLab::Interface] The primary interface for the container.

# 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