class Net::DNS::RR::MR

Mail Rename Record (MR)

Class for DNS MR resource records.

Attributes

newname[R]

Gets the newname value.

Returns a String.

Public Instance Methods

value() click to toggle source

Gets the standardized value for this record, represented by the value of newname.

Returns a String.

# File lib/net/dns/rr/mr.rb, line 19
def value
  newname.to_s
end

Private Instance Methods

build_pack() click to toggle source
# File lib/net/dns/rr/mr.rb, line 59
def build_pack
  @newname_pack = pack_name(@newname)
  @rdlength = @newname_pack.size
end
check_name(input) click to toggle source
# File lib/net/dns/rr/mr.rb, line 50
def check_name(input)
  name = input.to_s
  unless name =~ /(\w\.?)+\s*$/
    raise ArgumentError, "Invalid Domain Name `#{name}'"
  end

  name
end
get_data() click to toggle source
# File lib/net/dns/rr/mr.rb, line 64
def get_data
  @newname_pack
end
get_inspect() click to toggle source
# File lib/net/dns/rr/mr.rb, line 46
def get_inspect
  value
end
set_type() click to toggle source
# File lib/net/dns/rr/mr.rb, line 42
def set_type
  @type = Net::DNS::RR::Types.new("MR")
end
subclass_new_from_binary(data, offset) click to toggle source
# File lib/net/dns/rr/mr.rb, line 37
def subclass_new_from_binary(data, offset)
  @newname = dn_expand(data, offset)
  offset
end
subclass_new_from_hash(options) click to toggle source
# File lib/net/dns/rr/mr.rb, line 25
def subclass_new_from_hash(options)
  if options.key?(:newname)
    @newname = check_name(options[:newname])
  else
    raise ArgumentError, ":newname field is mandatory"
  end
end
subclass_new_from_string(str) click to toggle source
# File lib/net/dns/rr/mr.rb, line 33
def subclass_new_from_string(str)
  @newname = check_name(str)
end