Class: Indocker::Networks::Network
- Inherits:
-
Object
- Object
- Indocker::Networks::Network
- Defined in:
- lib/indocker/networks/network.rb
Instance Attribute Summary collapse
-
#containers ⇒ Object
readonly
Returns the value of attribute containers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_container(container) ⇒ Object
-
#initialize(name) ⇒ Network
constructor
A new instance of Network.
Constructor Details
#initialize(name) ⇒ Network
Returns a new instance of Network.
4 5 6 7 |
# File 'lib/indocker/networks/network.rb', line 4 def initialize(name) @name = name @containers = [] end |
Instance Attribute Details
#containers ⇒ Object (readonly)
Returns the value of attribute containers.
2 3 4 |
# File 'lib/indocker/networks/network.rb', line 2 def containers @containers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/indocker/networks/network.rb', line 2 def name @name end |
Instance Method Details
#add_container(container) ⇒ Object
9 10 11 |
# File 'lib/indocker/networks/network.rb', line 9 def add_container(container) @containers.push(container) if !@containers.include?(container) end |