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.



91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/dnsruby/cache.rb', line 91

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.



90
91
92
# File 'lib/dnsruby/cache.rb', line 90

def qclass
  @qclass
end

#qnameObject

Returns the value of attribute qname.



90
91
92
# File 'lib/dnsruby/cache.rb', line 90

def qname
  @qname
end

#qtypeObject

Returns the value of attribute qtype.



90
91
92
# File 'lib/dnsruby/cache.rb', line 90

def qtype
  @qtype
end

Instance Method Details

#to_sObject



104
105
106
# File 'lib/dnsruby/cache.rb', line 104

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