Class: DBus::Data::ObjectPath

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

Overview

See also ObjectPath

Instance Attribute Summary

Attributes inherited from Base

#value

Class Method Summary collapse

Methods inherited from StringLike

fixed?, #initialize

Methods inherited from Basic

basic?, from_typed, type, #type

Methods inherited from Base

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

Constructor Details

This class inherits a constructor from DBus::Data::StringLike

Class Method Details

.alignmentObject



454
455
456
# File 'lib/dbus/data.rb', line 454

def self.alignment
  4
end

.from_raw(value, mode:) ⇒ Object



469
470
471
472
473
474
475
476
# File 'lib/dbus/data.rb', line 469

def self.from_raw(value, mode:)
  if mode == :plain
    validate_raw!(value)
    return value
  end

  new(value)
end

.size_classObject



458
459
460
# File 'lib/dbus/data.rb', line 458

def self.size_class
  UInt32
end

.type_codeObject



450
451
452
# File 'lib/dbus/data.rb', line 450

def self.type_code
  "o"
end

.validate_raw!(value) ⇒ Object

Raises:

  • InvalidPacketException



463
464
465
466
467
# File 'lib/dbus/data.rb', line 463

def self.validate_raw!(value)
  DBus::ObjectPath.new(value)
rescue DBus::Error => e
  raise InvalidPacketException, e.message
end