Class: Indocker::Networks::Network

Inherits:
Object
  • Object
show all
Defined in:
lib/indocker/networks/network.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#containersObject (readonly)

Returns the value of attribute containers.



2
3
4
# File 'lib/indocker/networks/network.rb', line 2

def containers
  @containers
end

#nameObject (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