Class: BarnyardDns::DnsObject
- Inherits:
-
Object
- Object
- BarnyardDns::DnsObject
- Defined in:
- lib/barnyard_dns.rb
Instance Attribute Summary collapse
-
#began_at ⇒ Object
readonly
Returns the value of attribute began_at.
-
#ended_at ⇒ Object
readonly
Returns the value of attribute ended_at.
-
#synchronizer ⇒ Object
readonly
Returns the value of attribute synchronizer.
Instance Method Summary collapse
-
#initialize(args) ⇒ DnsObject
constructor
A new instance of DnsObject.
Constructor Details
#initialize(args) ⇒ DnsObject
Returns a new instance of DnsObject.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/barnyard_dns.rb', line 13 def initialize(args) @began_at = Time.now @debug = args.fetch(:debug) { false } @log = args.fetch(:logger) { Logger.new(STDOUT) } @zone = args.fetch(:zone) { raise "You must provide the :zone to transfer." } @log.debug JSON.pretty_generate(args) @synchronizer = BarnyardHarvester::Sync.new(args) @synchronizer.run do zt = Dnsruby::ZoneTransfer.new zt.transfer_type = Dnsruby::Types.AXFR zone = zt.transfer(@zone) next if zone.nil? zone.each do |rec| @synchronizer.process rec.name, rec end end @log.info @synchronizer.stats end |
Instance Attribute Details
#began_at ⇒ Object (readonly)
Returns the value of attribute began_at.
11 12 13 |
# File 'lib/barnyard_dns.rb', line 11 def began_at @began_at end |
#ended_at ⇒ Object (readonly)
Returns the value of attribute ended_at.
11 12 13 |
# File 'lib/barnyard_dns.rb', line 11 def ended_at @ended_at end |
#synchronizer ⇒ Object (readonly)
Returns the value of attribute synchronizer.
11 12 13 |
# File 'lib/barnyard_dns.rb', line 11 def synchronizer @synchronizer end |