Class Dnsruby::RR::GPOS
In: lib/dnsruby/resource/GPOS.rb
Parent: RR

Class for Geographic Position (GPOS) resource records.

RFC 1712 (www.ietf.org/rfc/rfc1712.txt)

Methods

Constants

TypeValue = Types::GPOS
ClassValue = Classes::IN
REQUIRED_KEYS = [:longitude, :latitude, :altitude]

Attributes

altitude  [RW] 
latitude  [RW] 
longitude  [RW] 

Public Class methods

Create an instance from an ordered parameter list, e.g.: EXAMPLE_GPOS_DATA = begin

  rdata = RR::GPOS.build_rdata(EXAMPLE_LONGITUDE, EXAMPLE_LATITUDE, EXAMPLE_ALTITUDE)
  [EXAMPLE_HOSTNAME, Types::GPOS, Classes::IN, EXAMPLE_TTL, rdata.length, rdata, 0]

end self.from_data(*EXAMPLE_GPOS_DATA)

Create an instance from a hash of parameters, e.g.:

 {
    name:       'techhumans.com',
    type:       Types::GPOS,
    ttl:        1234,
    longitude:  '10.0',
    latitude:   '20.0',
    altitude:   '30.0',
 }

Since the type is assumed to be GPOS, it will be assigned automatially, and any other value will be overwritten. Therefore, having it present in the hash is not necessary.

Create an instance from a string containing parameters, e.g.: ‘a.dnsruby.com. 10800 IN GPOS 10.0 20.0 30.0‘

Public Instance methods

‘name’ is used in the RR superclass, but ‘owner’ is the term referred to in the RFC, so we‘ll make owner an alias for name.

‘name’ is used in the RR superclass, but ‘owner’ is the term referred to in the RFC, so we‘ll make owner an alias for name.

From the RFC:

   GPOS has the following format:

<owner> <ttl> <class> GPOS <longitude> <latitude> <altitude>

We handle the rdata, the RR superclass does the rest.

[Validate]