Files

DBus::Signal

D-Bus interface signal class

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

Public Instance Methods

from_prototype(prototype) click to toggle source

Add parameter types based on the given prototype.

# 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
to_xml() click to toggle source

Return an XML string representation of the signal interface elment.

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

Generated with the Darkfish Rdoc Generator 2.