# class DBus::ObjectPath

A {::String} that validates at initialization time

### Public Class Methods

new(s) click to toggle source

@raise `Error` if not a valid object path

Calls superclass method

       # File lib/dbus/object_path.rb
    13 def initialize(s)
    14   unless self.class.valid?(s)
    15     raise DBus::Error, "Invalid object path #{s.inspect}"
    16   end
    17   super
    18 end

valid?(s) click to toggle source

       # File lib/dbus/object_path.rb
    20 def self.valid?(s)
    21   s == "/" || s =~ %r{\A(/[A-Za-z0-9_]+)+\z}
    22 end