Class DBus::InterfaceElement
In: lib/dbus/introspect.rb
Parent: Object

D-Bus interface element class

This is a generic class for entities that are part of the interface such as methods and signals.

Methods

Attributes

name  [R]  The name of the interface element. Symbol
params  [R]  The parameters of the interface element. Array: FormalParameter

Public Class methods

Creates a new element with the given name.

[Source]

# File lib/dbus/introspect.rb, line 118
    def initialize(name)
      validate_name(name.to_s)
      @name = name
      @params = Array.new
    end

Public Instance methods

Adds a formal parameter with name and signature (See also Message#add_param which takes signature+value)

[Source]

# File lib/dbus/introspect.rb, line 126
    def add_fparam(name, signature)
      @params << FormalParameter.new(name, signature)
    end

Deprecated, for backward compatibility

[Source]

# File lib/dbus/introspect.rb, line 131
    def add_param(name_signature_pair)
      add_fparam(*name_signature_pair)
    end

Validates element name.

[Source]

# File lib/dbus/introspect.rb, line 111
    def validate_name(name)
      if (not name =~ MethodSignalRE) or (name.bytesize > 255)
        raise InvalidMethodName, name
      end
    end

[Validate]