class DBus::EmitsChangedSignal

Describes the behavior of PropertiesChanged signal, for a single property or for an entire interface.

The possible values are:

The default is:

@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

value[R]

@return [true,false,:const,:invalidates]

Public Class Methods

new(value, interface: nil) click to toggle source

@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 42
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

==(other) click to toggle source
# File lib/dbus/emits_changed_signal.rb, line 71
def ==(other)
  if other.is_a?(self.class)
    other.value == @value
  else
    other == value
  end
end
Also aliased as: eql?
eql?(other)
Alias for: ==
to_s() click to toggle source
# File lib/dbus/emits_changed_signal.rb, line 67
def to_s
  @value.to_s
end
to_xml() click to toggle source

Return introspection XML string representation @return [String]

# File lib/dbus/emits_changed_signal.rb, line 61
def to_xml
  return "" if @value == true

  "    <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"#{@value}\"/>\n"
end