class 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 243 def from_prototype(prototype) 244 prototype.split(/, */).each do |arg| 245 if arg =~ /:/ 246 arg = arg.split(":") 247 name, sig = arg 248 else 249 sig = arg 250 end 251 add_fparam(name, sig) 252 end 253 self 254 end
to_xml()
click to toggle source
Return an XML string representation of the signal interface elment.
# File lib/dbus/introspect.rb 257 def to_xml 258 xml = " <signal name=\"#{@name}\">\n" 259 @params.each do |param| 260 name = param.name ? "name=\"#{param.name}\" " : "" 261 xml += " <arg #{name}type=\"#{param.type}\"/>\n" 262 end 263 xml += " </signal>\n" 264 xml 265 end