Class: DBus::Data::Container

Inherits:
Base
  • Object
show all
Defined in:
lib/dbus/data.rb

Overview

Contains one or more other values.

Direct Known Subclasses

Array, Struct, Variant

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, assert_type_matches_class, from_typed, #initialize, type_code

Constructor Details

This class inherits a constructor from DBus::Data::Base

Instance Attribute Details

#typeObject (readonly)

For containers, the type varies among instances

See Also:



523
524
525
# File 'lib/dbus/data.rb', line 523

def type
  @type
end

Class Method Details

.basic?Boolean

Returns:



513
514
515
# File 'lib/dbus/data.rb', line 513

def self.basic?
  false
end

.fixed?Boolean

Returns:



517
518
519
# File 'lib/dbus/data.rb', line 517

def self.fixed?
  false
end

Instance Method Details

#eql?(other) ⇒ Boolean

Hash key equality See ruby-doc.org/core-3.0.0/Object.html#method-i-eql-3F Stricter than #== (RSpec: eq), 1==1.0 but 1.eql(1.0)->false

Returns:



538
539
540
541
542
# File 'lib/dbus/data.rb', line 538

def eql?(other)
  return false unless other.class == self.class

  other.exact_value.eql?(exact_value)
end

#exact_valueObject

Returns something that is, or contains, Base. Er, this docs kinda sucks.

Returns:

  • something that is, or contains, Base. Er, this docs kinda sucks.



527
528
529
# File 'lib/dbus/data.rb', line 527

def exact_value
  @value
end

#valueObject



531
532
533
# File 'lib/dbus/data.rb', line 531

def value
  @value.map(&:value)
end