Class: Gem::Resolv::DNS::Resource::LOC
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Gem::Resolv::DNS::Resource
|
Defined in: | lib/rubygems/vendor/resolv/lib/resolv.rb |
Overview
Location resource
Constant Summary
-
TypeValue =
Internal use only
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 244729
::Gem::Resolv::DNS::Resource
- Inherited
Class Method Summary
- .new(version, ssize, hprecision, vprecision, latitude, longitude, altitude) ⇒ LOC constructor
- .decode_rdata(msg) Internal use only
::Gem::Resolv::DNS::Resource
- Inherited
::Gem::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.
::Gem::Resolv::DNS::Resource
- Inherited
#ttl | Remaining Time To Live for this |
Instance Method Summary
- #encode_rdata(msg) Internal use only
::Gem::Resolv::DNS::Resource
- Inherited
::Gem::Resolv::DNS::Query
- Inherited
Constructor Details
.new(version, ssize, hprecision, vprecision, latitude, longitude, altitude) ⇒ LOC
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2449
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
Class Method Details
.decode_rdata(msg)
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2513
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 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/rubygems/vendor/resolv/lib/resolv.rb', line 2500
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/rubygems/vendor/resolv/lib/resolv.rb', line 2475
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/rubygems/vendor/resolv/lib/resolv.rb', line 2488
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/rubygems/vendor/resolv/lib/resolv.rb', line 2494
attr_reader :longitude
#ssize (readonly)
The spherical size of this LOC
in meters using scientific notation as 2 integers of XeY
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2468
attr_reader :ssize
#version (readonly)
Returns the version value for this LOC
record which should always be 00
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2462
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/rubygems/vendor/resolv/lib/resolv.rb', line 2482
attr_reader :vprecision
Instance Method Details
#encode_rdata(msg)
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2503
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