class DBus::Property

An (exported) property dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties

Attributes

access[R]

@return [Symbol] :read :write or :readwrite

name[R]

@return [Symbol] The name of the property, for example FooBar.

ruby_name[R]

@return [Symbol,nil] What to call at Ruby side.

(Always without the trailing `=`)
It is `nil` IFF representing a client-side proxy.
type[R]

@return [Type]

Public Class Methods

from_xml(xml_node) click to toggle source

@param xml_node [AbstractXML::Node] @return [Property]

    # File lib/dbus/introspect.rb
308 def self.from_xml(xml_node)
309   name = xml_node["name"].to_sym
310   type = xml_node["type"]
311   access = xml_node["access"].to_sym
312   new(name, type, access, ruby_name: nil)
313 end
new(name, type, access, ruby_name:) click to toggle source
    # File lib/dbus/introspect.rb
283 def initialize(name, type, access, ruby_name:)
284   @name = name.to_sym
285   type = DBus.type(type) unless type.is_a?(Type)
286   @type = type
287   @access = access
288   @ruby_name = ruby_name
289 end

Public Instance Methods

readable?() click to toggle source

@return [Boolean]

    # File lib/dbus/introspect.rb
292 def readable?
293   access == :read || access == :readwrite
294 end
to_xml() click to toggle source

Return introspection XML string representation of the property.

    # File lib/dbus/introspect.rb
302 def to_xml
303   "    <property type=\"#{@type}\" name=\"#{@name}\" access=\"#{@access}\"/>\n"
304 end
writable?() click to toggle source

@return [Boolean]

    # File lib/dbus/introspect.rb
297 def writable?
298   access == :write || access == :readwrite
299 end