Module: XDR::Double

Extended by:
Concerns::ConvertsToXDR, Concerns::FloatConverter
Defined in:
lib/xdr/double.rb

Class Method Summary collapse

Methods included from Concerns::ConvertsToXDR

from_xdr, read, to_xdr, valid?, write

Methods included from Concerns::FloatConverter

valid?

Class Method Details

.read(io) ⇒ Object



10
11
12
# File 'lib/xdr/double.rb', line 10

def self.read(io)
  read_bytes(io, 8).unpack1("G")
end

.write(val, io) ⇒ Object

Raises:



5
6
7
8
# File 'lib/xdr/double.rb', line 5

def self.write(val, io)
  raise XDR::WriteError unless valid?(val)
  io.write [val].pack("G")
end