Class: DBus::Data::DictEntry

Inherits:
Struct show all
Defined in:
lib/dbus/data.rb

Overview

Dictionary/Hash entry. TODO: shouldn’t instantiate?

Instance Attribute Summary

Attributes inherited from Container

#type

Attributes inherited from Base

#value

Class Method Summary collapse

Methods inherited from Struct

#==, alignment, #initialize

Methods inherited from Container

basic?, #eql?, #exact_value, fixed?, #value

Methods inherited from Base

#==, assert_type_matches_class, basic?, #eql?, fixed?, #initialize, #type

Constructor Details

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

Class Method Details

.from_items(value, mode:, type:) ⇒ Object

Parameters:

  • value (::Array)


695
696
697
698
699
# File 'lib/dbus/data.rb', line 695

def self.from_items(value, mode:, type:) # rubocop:disable Lint/UnusedMethodArgument
  value.freeze
  # DictEntry ignores the :exact mode
  value
end

.from_typed(value, type:) ⇒ DictEntry

Parameters:

  • value (::Object)

    (#size, #each)

  • type (Type)

Returns:



704
705
706
# File 'lib/dbus/data.rb', line 704

def self.from_typed(value, type:)
  new(value, type: type)
end

.type_codeObject



690
691
692
# File 'lib/dbus/data.rb', line 690

def self.type_code
  "e"
end