Class DBus::Signal
In: lib/dbus/introspect.rb
Parent: InterfaceElement

D-Bus interface signal class

This is a class representing signals that are part of an interface.

Methods

Public Instance methods

Add parameter types based on the given prototype.

[Source]

# File lib/dbus/introspect.rb, line 197
    def from_prototype(prototype)
      prototype.split(/, */).each do |arg|
        if arg =~ /:/
          arg = arg.split(":")
          name, sig = arg
        else
          sig = arg
        end
        add_fparam(name, sig)
      end
      self
    end

Return an XML string representation of the signal interface elment.

[Source]

# File lib/dbus/introspect.rb, line 211
    def to_xml
      xml = %{<signal name="#{@name}">\n}
      @params.each do |param|
        name = param.name ? %{name="#{param.name}" } : ""
        xml += %{<arg #{name}type="#{param.type}"/>\n}
      end
      xml += %{</signal>\n}
      xml
    end

[Validate]