Module: DNSer

Defined in:
lib/dnser.rb,
lib/dnser/domain.rb,
lib/dnser/record.rb,
lib/dnser/builder.rb,
lib/dnser/version.rb,
lib/dnser/template.rb,
lib/dnser/records/soa.rb,
lib/dnser/records/srv.rb,
lib/dnser/records/base.rb,
lib/dnser/builders/stream.rb

Defined Under Namespace

Classes: BaseRecord, Builder, Config, Domain, Record, SoaRecord, SrvRecord, StreamBuilder, Template

Constant Summary collapse

VERSION =
'0.0.3'

Class Method Summary collapse

Class Method Details

.apply_template(name, &block) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/dnser.rb', line 16

def self.apply_template name, &block
  if @templates
    tpl = @templates[name.to_s.downcase.to_sym].dup rescue nil
    yield tpl if tpl if block_given?
    raise Template::Unknown.new(name.to_s.downcase.to_sym), 'Unknown DNS template' unless tpl
    tpl
  end
end

.configObject



25
26
27
# File 'lib/dnser.rb', line 25

def self.config
  Config.instance
end

.create_template(name, params = {}, &block) ⇒ Object



11
12
13
14
# File 'lib/dnser.rb', line 11

def self.create_template name, params = {}, &block
  @templates ||= {}
  @templates[name.to_s.downcase.to_sym] = DNSer::Template.new params, &block
end

.domain(domain_name, params = {}, &block) ⇒ Object



7
8
9
# File 'lib/dnser.rb', line 7

def self.domain domain_name, params = {} , &block
  Domain.new domain_name, params, &block
end