In Files

Parent

Files

DBus::Node

Object path node class

Class representing a node on an object path.

Attributes

name[R]

The name of the node.

object[RW]

The D-Bus object contained by the node.

Public Class Methods

new(name) click to toggle source

Create a new node with a given name.

# File lib/dbus/bus.rb, line 137
def initialize(name)
  @name = name
  @object = nil
end

Public Instance Methods

inspect() click to toggle source

Return inspect information of the node.

# File lib/dbus/bus.rb, line 165
def inspect
  # Need something here
  "<DBus::Node #{sub_inspect}>"
end
sub_inspect() click to toggle source

Return instance inspect information, used by Node#inspect.

# File lib/dbus/bus.rb, line 171
def sub_inspect
  s = ""
  if not @object.nil?
    s += "%x " % @object.object_id
  end
  s + "{" + keys.collect { |k| "#{k} => #{self[k].sub_inspect}" }.join(",") + "}"
end
to_xml() click to toggle source

Return an XML string representation of the node. It is shallow, not recursing into subnodes

# File lib/dbus/bus.rb, line 144
    def to_xml
      xml = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
'
      self.each_pair do |k, v|
        xml += "<node name=\"#{k}\" />"
      end
      if @object
        @object.intfs.each_pair do |k, v|
          xml += %{<interface name="#{v.name}">\n}
          v.methods.each_value { |m| xml += m.to_xml }
          v.signals.each_value { |m| xml += m.to_xml }
          xml +="</interface>\n"
        end
      end
      xml += '</node>'
      xml
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.