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 114 def initialize(name) 115 validate_name(name.to_s) 116 @name = name 117 @params = [] 118 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 122 def add_fparam(name, signature) 123 @params << FormalParameter.new(name, signature) 124 end
add_param(name_signature_pair)
click to toggle source
Deprecated, for backward compatibility
# File lib/dbus/introspect.rb 127 def add_param(name_signature_pair) 128 add_fparam(*name_signature_pair) 129 end
validate_name(name)
click to toggle source
Validates element name.
# File lib/dbus/introspect.rb 108 def validate_name(name) 109 return if (name =~ METHOD_SIGNAL_RE) && (name.bytesize <= 255) 110 raise InvalidMethodName, name 111 end