class TLV::PathContainer

Overview

PathContainer is a wrapper around a hash that preserves the PATH container type during encode/decode cycles. This is necessary because PATH (0x17) and STRUCTURE (0x15) containers have different semantics in the Matter protocol, but both decode to hashes. PATH containers contain tagged elements (endpoint, cluster, attribute) like structures.

Defined in:

tlv/path_container.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(elements : Hash(Tag, Value) = {} of Tag => Value) #

[View source]

Instance Method Detail

def ==(other : Hash(Tag, Value)) #

[View source]
def ==(other : PathContainer) #

[View source]
def [](key : Tag) #

[View source]
def []=(key : Tag, value : Value) #

[View source]
def []?(key : Tag) #

[View source]
def each(&) #

[View source]
def elements : Hash(Tag, Value) #

[View source]
def empty? #

[View source]
def has_key?(key : Tag) #

[View source]
def inspect(io : IO) #
Description copied from class Reference

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>

[View source]
def keys #

[View source]
def map(&block) #

[View source]
def size #

[View source]
def to_h : Hash(String | {Int32?, Int32} | UInt8 | Nil, TLV::Value) #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def values #

[View source]