Method: CTypes::Type#pack

Defined in:
lib/ctypes/type.rb

#pack(value, endian: default_endian, validate: true) ⇒ ::String

encode a ruby type into a String containing the binary representation of the c type

Parameters:

  • value

    value to be encoded

  • endian (Symbol) (defaults to: default_endian)

    endian to pack with

  • validate (Boolean) (defaults to: true)

    set to false to disable value validation

Returns:

  • (::String)

    binary encoding for value

Raises:

  • (NotImplementedError)

See Also:



31
32
33
# File 'lib/ctypes/type.rb', line 31

def pack(value, endian: default_endian, validate: true)
  raise NotImplementedError
end