Class: Nl::Protocols::Genl::GenlMsgHdr

Inherits:
Struct
  • Object
show all
Defined in:
lib/nl/protocols/genl.rb,
lib/nl/protocols/genl.rb

Constant Summary collapse

FORMAT =
Ractor.make_shareable([
  Endian::Host::U8,
  Endian::Host::U8,
  Endian::Host::U16,
])

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cmdObject

Returns the value of attribute cmd

Returns:

  • (Object)

    the current value of cmd



5
6
7
# File 'lib/nl/protocols/genl.rb', line 5

def cmd
  @cmd
end

#reservedObject

Returns the value of attribute reserved

Returns:

  • (Object)

    the current value of reserved



5
6
7
# File 'lib/nl/protocols/genl.rb', line 5

def reserved
  @reserved
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



5
6
7
# File 'lib/nl/protocols/genl.rb', line 5

def version
  @version
end

Class Method Details

.decode(decoder) ⇒ Object



13
14
15
# File 'lib/nl/protocols/genl.rb', line 13

def self.decode(decoder)
  new(*decoder.get_values(FORMAT))
end

Instance Method Details

#encode(encoder) ⇒ Object



17
18
19
# File 'lib/nl/protocols/genl.rb', line 17

def encode(encoder)
  encoder.put_values(FORMAT, to_a)
end