Class: Dnsruby::Cache::CacheKey
- Inherits:
-
Object
- Object
- Dnsruby::Cache::CacheKey
- Defined in:
- lib/dnsruby/cache.rb
Overview
:nodoc: all
Instance Attribute Summary collapse
-
#qclass ⇒ Object
Returns the value of attribute qclass.
-
#qname ⇒ Object
Returns the value of attribute qname.
-
#qtype ⇒ Object
Returns the value of attribute qtype.
Instance Method Summary collapse
-
#initialize(*args) ⇒ CacheKey
constructor
A new instance of CacheKey.
- #to_s ⇒ Object
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
#qclass ⇒ Object
Returns the value of attribute qclass.
98 99 100 |
# File 'lib/dnsruby/cache.rb', line 98 def qclass @qclass end |
#qname ⇒ Object
Returns the value of attribute qname.
98 99 100 |
# File 'lib/dnsruby/cache.rb', line 98 def qname @qname end |
#qtype ⇒ Object
Returns the value of attribute qtype.
98 99 100 |
# File 'lib/dnsruby/cache.rb', line 98 def qtype @qtype end |
Instance Method Details
#to_s ⇒ Object
112 113 114 |
# File 'lib/dnsruby/cache.rb', line 112 def to_s return "#{qname.inspect.downcase} #{qclass} #{qtype}" end |