Class: Resolv::DNS::Resource::SOA

Inherits:
Resolv::DNS::Resource show all
Defined in:
lib/resolv.rb

Overview

Start Of Authority resource.

Constant Summary collapse

TypeValue =

:nodoc:

6

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes, ClassValue

Instance Attribute Summary collapse

Attributes inherited from Resolv::DNS::Resource

#ttl

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resolv::DNS::Resource

#==, #eql?, get_class, #hash

Constructor Details

#initialize(mname, rname, serial, refresh, retry_, expire, minimum) ⇒ SOA

Creates a new SOA record. See the attr documentation for the details of each argument.



2242
2243
2244
2245
2246
2247
2248
2249
2250
# File 'lib/resolv.rb', line 2242

def initialize(mname, rname, serial, refresh, retry_, expire, minimum)
  @mname = mname
  @rname = rname
  @serial = serial
  @refresh = refresh
  @retry = retry_
  @expire = expire
  @minimum = minimum
end

Instance Attribute Details

#expireObject (readonly)

Time in seconds that a secondary name server is to use the data before refreshing from the primary name server.



2283
2284
2285
# File 'lib/resolv.rb', line 2283

def expire
  @expire
end

#minimumObject (readonly)

The minimum number of seconds to be used for TTL values in RRs.



2288
2289
2290
# File 'lib/resolv.rb', line 2288

def minimum
  @minimum
end

#mnameObject (readonly)

Name of the host where the master zone file for this zone resides.



2255
2256
2257
# File 'lib/resolv.rb', line 2255

def mname
  @mname
end

#refreshObject (readonly)

How often, in seconds, a secondary name server is to check for updates from the primary name server.



2271
2272
2273
# File 'lib/resolv.rb', line 2271

def refresh
  @refresh
end

#retryObject (readonly)

How often, in seconds, a secondary name server is to retry after a failure to check for a refresh.



2277
2278
2279
# File 'lib/resolv.rb', line 2277

def retry
  @retry
end

#rnameObject (readonly)

The person responsible for this domain name.



2260
2261
2262
# File 'lib/resolv.rb', line 2260

def rname
  @rname
end

#serialObject (readonly)

The version number of the zone file.



2265
2266
2267
# File 'lib/resolv.rb', line 2265

def serial
  @serial
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:



2296
2297
2298
2299
2300
2301
2302
# File 'lib/resolv.rb', line 2296

def self.decode_rdata(msg) # :nodoc:
  mname = msg.get_name
  rname = msg.get_name
  serial, refresh, retry_, expire, minimum = msg.get_unpack('NNNNN')
  return self.new(
    mname, rname, serial, refresh, retry_, expire, minimum)
end

Instance Method Details

#encode_rdata(msg) ⇒ Object

:nodoc:



2290
2291
2292
2293
2294
# File 'lib/resolv.rb', line 2290

def encode_rdata(msg) # :nodoc:
  msg.put_name(@mname)
  msg.put_name(@rname)
  msg.put_pack('NNNNN', @serial, @refresh, @retry, @expire, @minimum)
end