Class: Hosum::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/hosum/container.rb

Direct Known Subclasses

Group, Hosts, Subject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContainer

Returns a new instance of Container.



9
10
11
12
13
# File 'lib/hosum/container.rb', line 9

def initialize
  self.children = []
  self.ips_list = []
  self.options = {}
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



4
5
6
# File 'lib/hosum/container.rb', line 4

def children
  @children
end

#ips_listObject

Returns the value of attribute ips_list.



7
8
9
# File 'lib/hosum/container.rb', line 7

def ips_list
  @ips_list
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/hosum/container.rb', line 5

def options
  @options
end

#parentObject

Returns the value of attribute parent.



3
4
5
# File 'lib/hosum/container.rb', line 3

def parent
  @parent
end

Instance Method Details

#find_first_ipObject



15
16
17
18
19
20
21
# File 'lib/hosum/container.rb', line 15

def find_first_ip
  if self.ips_list.empty?
    self.parent.find_first_ip if self.parent
  else
    self.ips_list.first.addresses.first
  end
end