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 193 def from_prototype(prototype) 194 prototype.split(/, */).each do |arg| 195 if arg =~ /:/ 196 arg = arg.split(":") 197 name, sig = arg 198 else 199 sig = arg 200 end 201 add_fparam(name, sig) 202 end 203 self 204 end
to_xml()
click to toggle source
Return an XML string representation of the signal interface elment.
# File lib/dbus/introspect.rb 207 def to_xml 208 xml = %(<signal name="#{@name}">\n) 209 @params.each do |param| 210 name = param.name ? %(name="#{param.name}" ) : "" 211 xml += %(<arg #{name}type="#{param.type}"/>\n) 212 end 213 xml += %(</signal>\n) 214 xml 215 end