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