Class: Dnsruby::RR::MINFO

Inherits:
Dnsruby::RR show all
Defined in:
lib/dnsruby/resource/MINFO.rb

Overview

Class for DNS Mailbox Information (MINFO) resource records. RFC 1035 Section 3.3.7

Constant Summary collapse

ClassValue =

:nodoc: all

nil
TypeValue =

:nodoc: all

Types::MINFO

Constants inherited from Dnsruby::RR

ClassInsensitiveTypes

Instance Attribute Summary collapse

Attributes inherited from Dnsruby::RR

#klass, #name, #rdata, #ttl, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Dnsruby::RR

#<=>, #==, #clone, create, #eql?, find_class, get_class, get_num, #hash, implemented_rrs, #init_defaults, new_from_data, new_from_hash, new_from_string, #rdlength, #sameRRset, #to_s

Instance Attribute Details

#emailbxObject

The RR’s error mailbox field.



27
28
29
# File 'lib/dnsruby/resource/MINFO.rb', line 27

def emailbx
  @emailbx
end

#rmailbxObject

The RR’s responsible mailbox field. See RFC 1035.



25
26
27
# File 'lib/dnsruby/resource/MINFO.rb', line 25

def rmailbx
  @rmailbx
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc: all



63
64
65
66
67
# File 'lib/dnsruby/resource/MINFO.rb', line 63

def self.decode_rdata(msg) #:nodoc: all
  rmailbx = msg.get_name
  emailbx = msg.get_name
  return self.new([rmailbx, emailbx])
end

Instance Method Details

#encode_rdata(msg, canonical = false) ⇒ Object

:nodoc: all



58
59
60
61
# File 'lib/dnsruby/resource/MINFO.rb', line 58

def encode_rdata(msg, canonical=false) #:nodoc: all
  msg.put_name(@rmailbx, canonical)
  msg.put_name(@emailbx, canonical)
end

#from_data(data) ⇒ Object

:nodoc: all



38
39
40
# File 'lib/dnsruby/resource/MINFO.rb', line 38

def from_data(data) #:nodoc: all
  @rmailbx, @emailbx = data
end

#from_hash(hash) ⇒ Object

:nodoc: all



29
30
31
32
33
34
35
36
# File 'lib/dnsruby/resource/MINFO.rb', line 29

def from_hash(hash) #:nodoc: all
  if (hash[:rmailbx])
    @rmailbx = Name.create(hash[:rmailbx])
  end
  if (hash[:emailbx])
    @emailbx = Name.create(hash[:emailbx])
  end
end

#from_string(input) ⇒ Object

:nodoc: all



42
43
44
45
46
47
48
# File 'lib/dnsruby/resource/MINFO.rb', line 42

def from_string(input) #:nodoc: all
  if (input.length > 0)
    names = input.split(" ")
    @rmailbx = Name.create(names[0])
    @emailbx = Name.create(names[1])
  end
end

#rdata_to_stringObject

:nodoc: all



50
51
52
53
54
55
56
# File 'lib/dnsruby/resource/MINFO.rb', line 50

def rdata_to_string #:nodoc: all
  if (@rmailbx!=nil)
    return "#{@rmailbx.to_s(true)} #{@emailbx.to_s(true)}"
  else
    return ""
  end
end