class Net::DNS::RR::MR

Mail Rename Record (MR)

Class for DNS MR resource records.

Public Instance Methods

newname() click to toggle source

Gets the newname value.

Returns a String.

# File lib/net/dns/rr/mr.rb, line 16
def newname
  @newname
end
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 24
def value
  newname.to_s
end

Private Instance Methods

build_pack() click to toggle source
# File lib/net/dns/rr/mr.rb, line 66
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 58
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 71
def get_data
  @newname_pack
end
get_inspect() click to toggle source
# File lib/net/dns/rr/mr.rb, line 53
def get_inspect
  value
end
set_type() click to toggle source
# File lib/net/dns/rr/mr.rb, line 49
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 43
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 31
def subclass_new_from_hash(options)
  if options.has_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 39
def subclass_new_from_string(str)
  @newname = check_name(str)
end