Method: CTypes::Type#unpack

Defined in:
lib/ctypes/type.rb

#unpack(buf, endian: default_endian) ⇒ Object

convert a String containing the binary represention of a c type into the equivalent ruby type

Parameters:

  • buf (::String)

    bytes that make up the type

  • endian (Symbol) (defaults to: default_endian)

    endian of data within buf

Returns:

  • decoded type

See Also:



49
50
51
52
# File 'lib/ctypes/type.rb', line 49

def unpack(buf, endian: default_endian)
  o, = unpack_one(buf, endian:)
  o
end