Class Dnsruby::RR::LOC
In: lib/Dnsruby/resource/LOC.rb
Parent: RR

Class for DNS Location (LOC) resource records. See RFC 1876 for details.

Methods

Constants

TypeValue = Types::LOC #:nodoc: all
POWEROFTEN = [1, 10, 100, 1_000, 10_000, 100_000, 1_000_000, 10_000_000, 100_000_000, 1_000_000_000]   Powers of 10 from 0 to 9 (used to speed up calculations).
REFERENCE_ALT = 100_000 * 100;   Reference altitude in centimeters (see RFC 1876).
REFERENCE_LATLON = 2**31;   Reference lat/lon (see RFC 1876).
CONV_SEC = 1000;   Conversions to/from thousandths of a degree.
CONV_MIN = 60 * CONV_SEC;
CONV_DEG = 60 * CONV_MIN;
DEFAULT_MIN = 0;   Defaults (from RFC 1876, Section 3).
DEFAULT_SEC = 0;
DEFAULT_SIZE = 1;
DEFAULT_HORIZ_PRE = 10_000;
DEFAULT_VERT_PRE = 10;

Attributes

altitude  [RW]  The altitude of the center of the sphere described by the size method, in centimeters, from a base of 100,000m below the WGS 84 reference spheroid used by GPS.
horiz_pre  [RW]  The horizontal precision of the data, in centimeters.
latitude  [RW]  The latitude of the center of the sphere described by the size method, in thousandths of a second of arc. 2**31 represents the equator; numbers above that are north latitude.
longitude  [RW]  The longitude of the center of the sphere described by the size method, in thousandths of a second of arc. 2**31 represents the prime meridian; numbers above that are east longitude.
size  [RW]  The diameter of a sphere enclosing the described entity, in centimeters.
version  [RW]  The version number of the representation; programs should always check this. Dnsruby currently supports only version 0.
vert_pre  [RW]  The vertical precision of the data, in centimeters.

Public Class methods

Public Instance methods

Returns the latitude and longitude as floating-point degrees. Positive numbers represent north latitude or east longitude; negative numbers represent south latitude or west longitude.

    lat, lon = rr.latlon
    system("xearth", "-pos", "fixed #{lat} #{lon}")

[Validate]