Class: VagrantRubydns::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-rubydns/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
8
# File 'lib/vagrant-rubydns/config.rb', line 5

def initialize
  @hosts = {}
  @enabled = false
end

Instance Attribute Details

#hostsObject

Returns the value of attribute hosts.



3
4
5
# File 'lib/vagrant-rubydns/config.rb', line 3

def hosts
  @hosts
end

Instance Method Details

#disableObject



14
15
16
# File 'lib/vagrant-rubydns/config.rb', line 14

def disable
  @enabled = false
end

#enable(enabled = true) ⇒ Object



10
11
12
# File 'lib/vagrant-rubydns/config.rb', line 10

def enable(enabled=true)
  @enabled = true
end

#enabled?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/vagrant-rubydns/config.rb', line 18

def enabled?
  @enabled
end

#host(hostname, ip_address) ⇒ Object



22
23
24
# File 'lib/vagrant-rubydns/config.rb', line 22

def host(hostname, ip_address)
  @hosts[hostname] = ip_address
end

#merge(other) ⇒ Object



26
27
28
29
30
# File 'lib/vagrant-rubydns/config.rb', line 26

def merge(other)
  super.tap do |result|
    result.hosts = @hosts.merge(other.hosts)
  end
end