Class: Hosum::Subject

Inherits:
Container show all
Defined in:
lib/hosum/subject.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/subject.rb', line 4

def name
  @name
end

Instance Method Details

#to_dnsmasq(options = {}) ⇒ Object



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

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

#to_hosts(options = {}) ⇒ Object



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

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