class DBus::InterfaceElement
D-Bus interface element class¶ ↑
This is a generic class for entities that are part of the interface such as methods and signals.
Attributes
name[R]
The name of the interface element. Symbol
params[R]
The parameters of the interface element. Array: FormalParameter
Public Class Methods
new(name)
click to toggle source
Creates a new element with the given name.
# File lib/dbus/introspect.rb 110 def initialize(name) 111 validate_name(name.to_s) 112 @name = name 113 @params = [] 114 end
Public Instance Methods
add_fparam(name, signature)
click to toggle source
Adds a formal parameter with name and signature (See also Message#add_param
which takes signature+value)
# File lib/dbus/introspect.rb 118 def add_fparam(name, signature) 119 @params << FormalParameter.new(name, signature) 120 end
add_param(name_signature_pair)
click to toggle source
Deprecated, for backward compatibility
# File lib/dbus/introspect.rb 123 def add_param(name_signature_pair) 124 add_fparam(*name_signature_pair) 125 end
validate_name(name)
click to toggle source
Validates element name.
# File lib/dbus/introspect.rb 104 def validate_name(name) 105 return if (name =~ METHOD_SIGNAL_RE) && (name.bytesize <= 255) 106 raise InvalidMethodName, name 107 end