Class: VagrantDNS::TldRegistry
- Inherits:
-
Object
- Object
- VagrantDNS::TldRegistry
- Includes:
- Store
- Defined in:
- lib/vagrant-dns/tld_registry.rb
Overview
This is the dns pattern registry (aka “config”) It basically delegates everything to a YAML::Store but handles the conversion of Regexp dns-patterns into YAML string keys and reverse.
Constant Summary collapse
- NAME =
"ltds"
Class Method Summary collapse
-
.open(tmp_path) ⇒ VagrantDNS::Registry?
Eitehr an instance or
nil
if cofig file does not exist.
Instance Method Summary collapse
-
#initialize(tmp_path) ⇒ TldRegistry
constructor
A new instance of TldRegistry.
Methods included from Store
Constructor Details
#initialize(tmp_path) ⇒ TldRegistry
Returns a new instance of TldRegistry.
10 11 12 |
# File 'lib/vagrant-dns/tld_registry.rb', line 10 def initialize(tmp_path) @store = YAML::Store.new(File.join(tmp_path, NAME), true) end |
Class Method Details
.open(tmp_path) ⇒ VagrantDNS::Registry?
Returns Eitehr an instance or nil
if cofig file does not exist.
15 16 17 |
# File 'lib/vagrant-dns/tld_registry.rb', line 15 def self.open(tmp_path) new(tmp_path) if File.exist?(File.join(tmp_path, NAME)) end |