This is a generic class for entities that are part of the interface such as methods and signals.
The name of the interface element. Symbol
The parameters of the interface element. Array: FormalParameter
Creates a new element with the given name.
# File lib/dbus/introspect.rb, line 118 def initialize(name) validate_name(name.to_s) @name = name @params = Array.new end
Adds a formal parameter with name and signature (See also DBus::Message#add_param which takes signature+value)
# File lib/dbus/introspect.rb, line 126 def add_fparam(name, signature) @params << FormalParameter.new(name, signature) end
Deprecated, for backward compatibility
# File lib/dbus/introspect.rb, line 131 def add_param(name_signature_pair) add_fparam(*name_signature_pair) end
Validates element name.
# File lib/dbus/introspect.rb, line 111 def validate_name(name) if (not name =~ MethodSignalRE) or (name.bytesize > 255) raise InvalidMethodName, name end end