Class: Gem::Resolv::DNS::Resource::LOC
- Inherits:
- 
      Gem::Resolv::DNS::Resource
      
        - Object
- Query
- Gem::Resolv::DNS::Resource
- Gem::Resolv::DNS::Resource::LOC
 
- Defined in:
- lib/rubygems/vendor/resolv/lib/resolv.rb
Overview
Location resource
Constant Summary collapse
- TypeValue =
          :nodoc: 
- 29
Constants inherited from Gem::Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
- 
  
    
      #altitude  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The altitude of the LOC above a reference sphere whose surface sits 100km below the WGS84 spheroid in centimeters as an unsigned 32bit integer. 
- 
  
    
      #hprecision  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The horizontal precision using ssize type values in meters using scientific notation as 2 integers of XeY for precision use value/2 e.g. 
- 
  
    
      #latitude  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The latitude for this LOC where 2**31 is the equator in thousandths of an arc second as an unsigned 32bit integer. 
- 
  
    
      #longitude  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The longitude for this LOC where 2**31 is the prime meridian in thousandths of an arc second as an unsigned 32bit integer. 
- 
  
    
      #ssize  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The spherical size of this LOC in meters using scientific notation as 2 integers of XeY. 
- 
  
    
      #version  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the version value for this LOC record which should always be 00. 
- 
  
    
      #vprecision  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The vertical precision using ssize type values in meters using scientific notation as 2 integers of XeY for precision use value/2 e.g. 
Attributes inherited from Gem::Resolv::DNS::Resource
Class Method Summary collapse
- 
  
    
      .decode_rdata(msg)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    :nodoc:. 
Instance Method Summary collapse
- 
  
    
      #encode_rdata(msg)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    :nodoc:. 
- 
  
    
      #initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude)  ⇒ LOC 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of LOC. 
Methods inherited from Gem::Resolv::DNS::Resource
Constructor Details
#initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude) ⇒ LOC
Returns a new instance of LOC.
| 2464 2465 2466 2467 2468 2469 2470 2471 2472 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2464 def initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude) @version = version @ssize = Gem::Resolv::LOC::Size.create(ssize) @hprecision = Gem::Resolv::LOC::Size.create(hprecision) @vprecision = Gem::Resolv::LOC::Size.create(vprecision) @latitude = Gem::Resolv::LOC::Coord.create(latitude) @longitude = Gem::Resolv::LOC::Coord.create(longitude) @altitude = Gem::Resolv::LOC::Alt.create(altitude) end | 
Instance Attribute Details
#altitude ⇒ Object (readonly)
The altitude of the LOC above a reference sphere whose surface sits 100km below the WGS84 spheroid in centimeters as an unsigned 32bit integer
| 2515 2516 2517 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2515 def altitude @altitude end | 
#hprecision ⇒ Object (readonly)
The horizontal precision using ssize type values in meters using scientific notation as 2 integers of XeY for precision use value/2 e.g. 2m = +/-1m
| 2490 2491 2492 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2490 def hprecision @hprecision end | 
#latitude ⇒ Object (readonly)
The latitude for this LOC where 2**31 is the equator in thousandths of an arc second as an unsigned 32bit integer
| 2503 2504 2505 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2503 def latitude @latitude end | 
#longitude ⇒ Object (readonly)
The longitude for this LOC where 2**31 is the prime meridian in thousandths of an arc second as an unsigned 32bit integer
| 2509 2510 2511 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2509 def longitude @longitude end | 
#ssize ⇒ Object (readonly)
The spherical size of this LOC in meters using scientific notation as 2 integers of XeY
| 2483 2484 2485 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2483 def ssize @ssize end | 
#version ⇒ Object (readonly)
Returns the version value for this LOC record which should always be 00
| 2477 2478 2479 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2477 def version @version end | 
#vprecision ⇒ Object (readonly)
The vertical precision using ssize type values in meters using scientific notation as 2 integers of XeY for precision use value/2 e.g. 2m = +/-1m
| 2497 2498 2499 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2497 def vprecision @vprecision end | 
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
| 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2527 def self.decode_rdata(msg) # :nodoc: version = msg.get_bytes(1) ssize = msg.get_bytes(1) hprecision = msg.get_bytes(1) vprecision = msg.get_bytes(1) latitude = msg.get_bytes(4) longitude = msg.get_bytes(4) altitude = msg.get_bytes(4) return self.new( version, Gem::Resolv::LOC::Size.new(ssize), Gem::Resolv::LOC::Size.new(hprecision), Gem::Resolv::LOC::Size.new(vprecision), Gem::Resolv::LOC::Coord.new(latitude,"lat"), Gem::Resolv::LOC::Coord.new(longitude,"lon"), Gem::Resolv::LOC::Alt.new(altitude) ) end | 
Instance Method Details
#encode_rdata(msg) ⇒ Object
:nodoc:
| 2517 2518 2519 2520 2521 2522 2523 2524 2525 | # File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2517 def encode_rdata(msg) # :nodoc: msg.put_bytes(@version) msg.put_bytes(@ssize.scalar) msg.put_bytes(@hprecision.scalar) msg.put_bytes(@vprecision.scalar) msg.put_bytes(@latitude.coordinates) msg.put_bytes(@longitude.coordinates) msg.put_bytes(@altitude.altitude) end |