Class: Dnsruby::Cache::CacheKey

Inherits:
Object
  • Object
show all
Defined in:
lib/Dnsruby/Cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CacheKey

Returns a new instance of CacheKey.



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/Dnsruby/Cache.rb', line 71

def initialize(*args)
  self.qclass = Classes.IN
  if (args.length > 0)
    self.qname = Name.create(args[0])
    self.qname.absolute = true
    if (args.length > 1)
      self.qtype = Types.new(args[1])
      if (args.length > 2)
        self.qclass = Classes.new(args[2])
      end
    end
  end
end

Instance Attribute Details

#qclassObject

Returns the value of attribute qclass.



70
71
72
# File 'lib/Dnsruby/Cache.rb', line 70

def qclass
  @qclass
end

#qnameObject

Returns the value of attribute qname.



70
71
72
# File 'lib/Dnsruby/Cache.rb', line 70

def qname
  @qname
end

#qtypeObject

Returns the value of attribute qtype.



70
71
72
# File 'lib/Dnsruby/Cache.rb', line 70

def qtype
  @qtype
end

Instance Method Details

#to_sObject



84
85
86
# File 'lib/Dnsruby/Cache.rb', line 84

def to_s
  return "#{qname.inspect.downcase} #{qclass} #{qtype}"
end