### Home Classes Methods

### In Files

- lib/dbus/bus.rb

### Parent

Hash

### Methods

- ::new
- #inspect
- #sub_inspect
- #to_xml

### Files

- README

### Class/Module Index

Quicksearch

- DBus
- DBus::ASessionBus
- DBus::ASystemBus
- DBus::AuthenticationFailed
- DBus::Authenticator
- DBus::Client
- DBus::Connection
- DBus::Connection::NameRequestError
- DBus::DBusCookieSHA1
- DBus::Error
- DBus::ErrorMessage
- DBus::External
- DBus::FormalParameter
- DBus::IncompleteBufferException
- DBus::Interface
- DBus::InterfaceElement
- DBus::IntrospectXMLParser
- DBus::InvalidClassDefinition
- DBus::InvalidDestinationName
- DBus::InvalidIntrospectionData
- DBus::InvalidMethodName
- DBus::InvalidPacketException
- DBus::InvalidParameters
- DBus::Main
- DBus::MatchRule
- DBus::MatchRuleException
- DBus::Message
- DBus::Method
- DBus::MethodNotImplemented
- DBus::MethodReturnMessage
- DBus::Node
- DBus::Object
- DBus::Object::UndefinedInterface
- DBus::PacketMarshaller
- DBus::PacketUnmarshaller
- DBus::ProxyObject
- DBus::ProxyObjectFactory
- DBus::ProxyObjectInterface
- DBus::RemoteBus
- DBus::Service
- DBus::SessionBus
- DBus::Signal
- DBus::SystemBus
- DBus::Type
- DBus::Type::Parser
- DBus::Type::SignatureException
- DBus::Type::Type
- DBus::TypeException
- DBus::UnknownSignal
- Integer

No matching classes.

# 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.