Class
SvcParams
for service binding RRs. [RFC9460]
Class Methods
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1727
def initialize(params = [])
@params = {}
params.each do |param|
add param
end
end
Create a list of SvcParams
with the given initial content.
params
has to be an enumerable of +SvcParam+s. If its content has +SvcParam+s with the duplicate key, the one appears last takes precedence.
Instance Methods
#
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1738
def [](key)
@params[canonical_key(key)]
end
Get SvcParam
for the given key
in this list.
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1759
def add(param)
@params[param.class.key_number] = param
end
Add the SvcParam
param
to this list, overwriting the existing one with the same key.
#
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1745
def count
@params.count
end
Get the number of SvcParams
in this list.
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1766
def delete(key)
@params.delete(canonical_key(key))
end
Remove the SvcParam
with the given key
and return it.
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1773
def each(&block)
return enum_for(:each) unless block
@params.each_value(&block)
end
Enumerate the +SvcParam+s in this list.
#
lib/resolv.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/resolv.rb, line 1752
def empty?
@params.empty?
end
Get whether this list is empty.