Module: TestLab::Container::Interface
- Included in:
- TestLab::Container
- Defined in:
- lib/testlab/container/interface.rb
Instance Method Summary collapse
-
#primary_interface ⇒ TestLab::Interface
Container primary interface.
Instance Method Details
#primary_interface ⇒ TestLab::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.
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 |