Class: Resolv::DNS::Resource::LOC
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Resolv::DNS::Resource
|
Defined in: | lib/resolv.rb |
Overview
Location resource
Constant Summary
-
TypeValue =
Internal use only
# File 'lib/resolv.rb', line 245929
::Resolv::DNS::Resource
- Inherited
Class Method Summary
- .new(version, ssize, hprecision, vprecision, latitude, longitude, altitude) ⇒ LOC constructor
- .decode_rdata(msg) Internal use only
::Resolv::DNS::Resource
- Inherited
::Resolv::DNS::Query
- Inherited
Instance Attribute Summary
-
#altitude
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
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
readonly
The latitude for this
LOC
where 2**31 is the equator in thousandths of an arc second as an unsigned 32bit integer. -
#longitude
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
readonly
The spherical size of this
LOC
in meters using scientific notation as 2 integers of XeY. -
#version
readonly
Returns the version value for this
LOC
record which should always be 00. -
#vprecision
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.
::Resolv::DNS::Resource
- Inherited
#ttl | Remaining Time To Live for this |
Instance Method Summary
- #encode_rdata(msg) Internal use only
::Resolv::DNS::Resource
- Inherited
::Resolv::DNS::Query
- Inherited
Constructor Details
.new(version, ssize, hprecision, vprecision, latitude, longitude, altitude) ⇒ LOC
# File 'lib/resolv.rb', line 2461
def initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude) @version = version @ssize = Resolv::LOC::Size.create(ssize) @hprecision = Resolv::LOC::Size.create(hprecision) @vprecision = Resolv::LOC::Size.create(vprecision) @latitude = Resolv::LOC::Coord.create(latitude) @longitude = Resolv::LOC::Coord.create(longitude) @altitude = Resolv::LOC::Alt.create(altitude) end
Class Method Details
.decode_rdata(msg)
# File 'lib/resolv.rb', line 2524
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, Resolv::LOC::Size.new(ssize), Resolv::LOC::Size.new(hprecision), Resolv::LOC::Size.new(vprecision), Resolv::LOC::Coord.new(latitude,"lat"), Resolv::LOC::Coord.new(longitude,"lon"), Resolv::LOC::Alt.new(altitude) ) end
Instance Attribute Details
#altitude (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
# File 'lib/resolv.rb', line 2512
attr_reader :altitude
#hprecision (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
# File 'lib/resolv.rb', line 2487
attr_reader :hprecision
#latitude (readonly)
The latitude for this LOC
where 2**31 is the equator in thousandths of an arc second as an unsigned 32bit integer
# File 'lib/resolv.rb', line 2500
attr_reader :latitude
#longitude (readonly)
The longitude for this LOC
where 2**31 is the prime meridian in thousandths of an arc second as an unsigned 32bit integer
# File 'lib/resolv.rb', line 2506
attr_reader :longitude
#ssize (readonly)
The spherical size of this LOC
in meters using scientific notation as 2 integers of XeY
# File 'lib/resolv.rb', line 2480
attr_reader :ssize
#version (readonly)
Returns the version value for this LOC
record which should always be 00
# File 'lib/resolv.rb', line 2474
attr_reader :version
#vprecision (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
# File 'lib/resolv.rb', line 2494
attr_reader :vprecision
Instance Method Details
#encode_rdata(msg)
# File 'lib/resolv.rb', line 2514
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