Class: Hosum::Group

Inherits:
Container show all
Defined in:
lib/hosum/group.rb

Instance Attribute Summary collapse

Attributes inherited from Container

#children, #ips_list, #options, #parent

Instance Method Summary collapse

Methods inherited from Container

#find_first_ip, #initialize

Constructor Details

This class inherits a constructor from Hosum::Container

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#to_dnsmasq(options = {}) ⇒ Object



10
11
12
# File 'lib/hosum/group.rb', line 10

def to_dnsmasq(options = {})
  "# #{self.name}\n" + children.map{ |c| c.to_dnsmasq(options) }.join
end

#to_hosts(options = {}) ⇒ Object



6
7
8
# File 'lib/hosum/group.rb', line 6

def to_hosts(options = {})
  "# #{self.name}\n" + children.map{ |c| c.to_hosts(options) }.join
end