Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/net/dns/rr/mr.rb
Views: 11784
# -*- coding: binary -*-1##2#3# Net::DNS::RR::MR4#5# $Id: MR.rb,v 1.4 2006/07/28 07:33:36 bluemonk Exp $6#7##89module Net10module DNS1112class RR1314#------------------------------------------------------------15# RR type MR16#------------------------------------------------------------17class MR < RR18attr_reader :newname1920private2122def check_name(name)23unless name =~ /(\w\.?)+\s*$/24raise RRArgumentError, "Name not valid: #{name.inspect}"25end26name27end2829def build_pack30@newname_pack = pack_name(@newname)31@rdlength = @newname_pack.size32end3334def set_type35@type = Net::DNS::RR::Types.new("MR")36end3738def get_data39@newname_pack40end4142def get_inspect43"#@newname"44end4546def subclass_new_from_hash(args)47if args.has_key? :newname48@newname = check_name args[:newname]49else50raise RRArgumentError, ":newname field is mandatory but missing"51end52end5354def subclass_new_from_string(str)55@newname = check_name(str)56end5758def subclass_new_from_array(data,offset)59@newname = dn_expand(data,offset)60return offset61end6263end # class MR6465end # class RR66end # module DNS67end # module Net686970