Class: Dnsruby::Cache::CacheKey

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsruby/cache.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CacheKey

Returns a new instance of CacheKey.



99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/dnsruby/cache.rb', line 99

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.



98
99
100
# File 'lib/dnsruby/cache.rb', line 98

def qclass
  @qclass
end

#qnameObject

Returns the value of attribute qname.



98
99
100
# File 'lib/dnsruby/cache.rb', line 98

def qname
  @qname
end

#qtypeObject

Returns the value of attribute qtype.



98
99
100
# File 'lib/dnsruby/cache.rb', line 98

def qtype
  @qtype
end

Instance Method Details

#to_sObject



112
113
114
# File 'lib/dnsruby/cache.rb', line 112

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