class DBus::EmitsChangedSignal
Describes the behavior of PropertiesChanged signal, for a single property or for an entire interface.
The possible values are:
-
true: the signal is emitted with the value included.
-
:invalidates: the signal is emitted but the value is not included in the signal.
-
:const: the property never changes value during the lifetime of the object it belongs to, and hence the signal is never emitted for it (but clients can cache the value)
-
false: the signal won’t be emitted (clients should re-Get the property value)
The default is:
-
for an interface: true
-
for a property: what the parent interface specifies
@see DBus::Object.emits_changed_signal @see DBus::Object.dbus_attr_accessor
@see dbus.freedesktop.org/doc/dbus-specification.html#introspection-format
Immutable once constructed.
Constants
- DEFAULT_ECS
Attributes
@return [true,false,:const,:invalidates]
Public Class Methods
@param value [true,false,:const,:invalidates,nil]
See class-level description above, {EmitsChangedSignal}.
@param interface [Interface,nil]
If the (property-level) *value* is unspecified (nil), this is the containing {Interface} to get the value from.
# File lib/dbus/emits_changed_signal.rb, line 43 def initialize(value, interface: nil) if value.nil? raise ArgumentError, "Both arguments are nil" if interface.nil? @value = interface.emits_changed_signal.value else expecting = [true, false, :const, :invalidates] unless expecting.include?(value) raise ArgumentError, "Expecting one of #{expecting.inspect}. Seen #{value.inspect}" end @value = value end freeze end
Public Instance Methods
# File lib/dbus/emits_changed_signal.rb, line 72 def ==(other) if other.is_a?(self.class) other.value == @value else other == value end end
# File lib/dbus/emits_changed_signal.rb, line 68 def to_s @value.to_s end
Return introspection XML string representation @return [String]
# File lib/dbus/emits_changed_signal.rb, line 62 def to_xml return "" if @value == true " <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"#{@value}\"/>\n" end