Class: VagrantRubydns::Config
- Inherits:
-
Object
- Object
- VagrantRubydns::Config
- Defined in:
- lib/vagrant-rubydns/config.rb
Instance Attribute Summary collapse
-
#hosts ⇒ Object
Returns the value of attribute hosts.
Instance Method Summary collapse
- #disable ⇒ Object
- #enable(enabled = true) ⇒ Object
- #enabled? ⇒ Boolean
- #host(hostname, ip_address) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #merge(other) ⇒ Object
Constructor Details
#initialize ⇒ Config
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
#hosts ⇒ Object
Returns the value of attribute hosts.
3 4 5 |
# File 'lib/vagrant-rubydns/config.rb', line 3 def hosts @hosts end |
Instance Method Details
#disable ⇒ Object
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
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 |