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]

@return [Symbol] The name of the interface element

params[R]

@return [Array<FormalParameter>] The parameters of the interface element

Public Class Methods

new(name) click to toggle source

Creates a new element with the given name.

    # File lib/dbus/introspect.rb
159 def initialize(name)
160   validate_name(name.to_s)
161   @name = name
162   @params = []
163 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
167 def add_fparam(name, signature)
168   @params << FormalParameter.new(name, signature)
169 end
add_param(name_signature_pair) click to toggle source

Deprecated, for backward compatibility

    # File lib/dbus/introspect.rb
172 def add_param(name_signature_pair)
173   add_fparam(*name_signature_pair)
174 end
validate_name(name) click to toggle source

Validates element name.

    # File lib/dbus/introspect.rb
152 def validate_name(name)
153   return if (name =~ METHOD_SIGNAL_RE) && (name.bytesize <= 255)
154 
155   raise InvalidMethodName, name
156 end