class DBus::ObjectPath
A {::String} that validates at initialization time. See also {DBus::Data::ObjectPath} @see dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-marshaling-object-path
Public Class Methods
new(str)
click to toggle source
@raise Error
if not a valid object path
Calls superclass method
# File lib/dbus/object_path.rb, line 17 def initialize(str) unless self.class.valid?(str) raise DBus::Error, "Invalid object path #{str.inspect}" end super end
valid?(str)
click to toggle source
# File lib/dbus/object_path.rb, line 25 def self.valid?(str) str == "/" || str =~ %r{\A(/[A-Za-z0-9_]+)+\z} end