Class: DBus::NodeTree
- Inherits:
-
Object
- Object
- DBus::NodeTree
- Defined in:
- lib/dbus/node_tree.rb
Overview
Has a tree of Nodes, refering to Objects or to ProxyObjects.
Direct Known Subclasses
Instance Attribute Summary collapse
- #root ⇒ Node readonly
Instance Method Summary collapse
-
#get_node(path, create: false) ⇒ Node?
Get the object node corresponding to the given path.
-
#initialize ⇒ NodeTree
constructor
A new instance of NodeTree.
Constructor Details
Instance Attribute Details
Instance Method Details
#get_node(path, create: false) ⇒ Node?
Get the object node corresponding to the given path.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dbus/node_tree.rb', line 27 def get_node(path, create: false) n = @root path.sub(%r{^/}, "").split("/").each do |elem| if !(n[elem]) return nil if !create n[elem] = Node.new(elem) end n = n[elem] end n end |