Class: Hosum::Container
- Inherits:
-
Object
- Object
- Hosum::Container
- Defined in:
- lib/hosum/container.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#ips_list ⇒ Object
Returns the value of attribute ips_list.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #find_first_ip ⇒ Object
-
#initialize ⇒ Container
constructor
A new instance of Container.
Constructor Details
#initialize ⇒ Container
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. = {} end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
4 5 6 |
# File 'lib/hosum/container.rb', line 4 def children @children end |
#ips_list ⇒ Object
Returns the value of attribute ips_list.
7 8 9 |
# File 'lib/hosum/container.rb', line 7 def ips_list @ips_list end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/hosum/container.rb', line 5 def @options end |
#parent ⇒ Object
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_ip ⇒ Object
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 |