Skip to Content Skip to Search

SvcParams for service binding RRs. [RFC9460]

Methods
#
A
C
D
E
N
Included Modules

Class Public methods

new(params = [])

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.

# File ruby/lib/resolv.rb, line 1723
def initialize(params = [])
  @params = {}

  params.each do |param|
    add param
  end
end

Instance Public methods

[](key)

Get SvcParam for the given key in this list.

# File ruby/lib/resolv.rb, line 1734
def [](key)
  @params[canonical_key(key)]
end

add(param)

Add the SvcParam param to this list, overwriting the existing one with the same key.

# File ruby/lib/resolv.rb, line 1755
def add(param)
  @params[param.class.key_number] = param
end

count()

Get the number of SvcParams in this list.

# File ruby/lib/resolv.rb, line 1741
def count
  @params.count
end

delete(key)

Remove the SvcParam with the given key and return it.

# File ruby/lib/resolv.rb, line 1762
def delete(key)
  @params.delete(canonical_key(key))
end

each(&block)

Enumerate the +SvcParam+s in this list.

# File ruby/lib/resolv.rb, line 1769
def each(&block)
  return enum_for(:each) unless block
  @params.each_value(&block)
end

empty?()

Get whether this list is empty.

# File ruby/lib/resolv.rb, line 1748
def empty?
  @params.empty?
end