Class: Dnsruby::RR::X25

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

Overview

Class for DNS X25 resource records. RFC 1183 Section 3.1

Constant Summary collapse

ClassValue =

:nodoc: all

nil
TypeValue =

:nodoc: all

Types::X25

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, #from_hash, 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

#addressObject

The PSDN address



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

def address
  @address
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc: all



49
50
51
52
# File 'lib/dnsruby/resource/X25.rb', line 49

def self.decode_rdata(msg) #:nodoc: all
  address = msg.get_string
  return self.new(*address)
end

Instance Method Details

#encode_rdata(msg, canonical = false) ⇒ Object

:nodoc: all



45
46
47
# File 'lib/dnsruby/resource/X25.rb', line 45

def encode_rdata(msg, canonical=false) #:nodoc: all
  msg.put_string(@address)
end

#from_data(data) ⇒ Object



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

def from_data(data)
  @address = data
end

#from_string(input) ⇒ Object



31
32
33
34
35
# File 'lib/dnsruby/resource/X25.rb', line 31

def from_string(input)
  address = input
  address.sub!(/^\"/, "")
  @address = address.sub(/\"$/, "")
end

#rdata_to_stringObject



37
38
39
40
41
42
43
# File 'lib/dnsruby/resource/X25.rb', line 37

def rdata_to_string
  if (@address!=nil)
    return @address
  else
    return ""
  end
end