Class: DBus::InterfaceElement
- Inherits:
-
Object
- Object
- DBus::InterfaceElement
- Defined in:
- lib/dbus/introspect.rb
Overview
D-Bus interface element class
This is a generic class for entities that are part of the interface such as methods and signals.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The name of the interface element.
-
#params ⇒ Object
readonly
The parameters of the interface element.
Instance Method Summary collapse
-
#add_param(param) ⇒ Object
Adds a parameter param.
-
#initialize(name) ⇒ InterfaceElement
constructor
Creates a new element with the given name.
-
#validate_name(name) ⇒ Object
Validates element name.
Constructor Details
#initialize(name) ⇒ InterfaceElement
Creates a new element with the given name.
96 97 98 99 100 |
# File 'lib/dbus/introspect.rb', line 96 def initialize(name) validate_name(name.to_s) @name = name @params = Array.new end |
Instance Attribute Details
#name ⇒ Object (readonly)
The name of the interface element.
84 85 86 |
# File 'lib/dbus/introspect.rb', line 84 def name @name end |
#params ⇒ Object (readonly)
The parameters of the interface element
86 87 88 |
# File 'lib/dbus/introspect.rb', line 86 def params @params end |
Instance Method Details
#add_param(param) ⇒ Object
Adds a parameter param.
103 104 105 |
# File 'lib/dbus/introspect.rb', line 103 def add_param(param) @params << param end |
#validate_name(name) ⇒ Object
Validates element name.
89 90 91 92 93 |
# File 'lib/dbus/introspect.rb', line 89 def validate_name(name) if (not name =~ MethodSignalRE) or (name.size > 255) raise InvalidMethodName end end |