Class: DBus::Data::Double

Inherits:
Fixed show all
Defined in:
lib/dbus/data.rb

Overview

Double-precision floating point number.

Constant Summary collapse

FORMAT =
Format.new("E", "G")

Instance Attribute Summary

Attributes inherited from Base

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fixed

fixed?, from_raw, #marshall

Methods inherited from Basic

basic?, from_typed, type, #type

Methods inherited from Base

#==, assert_type_matches_class, basic?, #eql?, fixed?, from_typed, #type

Constructor Details

#initialize(value) ⇒ Double

Returns a new instance of Double.

Parameters:

Raises:

  • TypeError,ArgumentError



391
392
393
394
395
# File 'lib/dbus/data.rb', line 391

def initialize(value)
  value = value.value if value.is_a?(self.class)
  value = Kernel.Float(value)
  super(value)
end

Class Method Details

.alignmentObject



380
381
382
# File 'lib/dbus/data.rb', line 380

def self.alignment
  8
end

.formatObject



385
386
387
# File 'lib/dbus/data.rb', line 385

def self.format
  FORMAT
end

.type_codeObject



376
377
378
# File 'lib/dbus/data.rb', line 376

def self.type_code
  "d"
end