class PowerDNS::Pipe::Answer

Answer object is just used to wrap the block that handles answering queries

Attributes

question[R]

Public Class Methods

new(pipe, question) click to toggle source
   # File lib/powerdns_pipe.rb
18 def initialize(pipe, question)
19   @pipe = pipe
20   @question = question
21 end

Public Instance Methods

answer(options = {}) click to toggle source
   # File lib/powerdns_pipe.rb
23 def answer(options = {})
24   options = {
25     :ttl => 3600,
26     :id => -1,
27     :class => 'IN'
28   }.merge options
29   return unless @question.qtype == "ANY" or @question.qtype == options[:type]
30   @pipe.send :respond, "DATA", options[:name], options[:class], options[:type], options[:ttl], options[:id], options[:content]
31 end