Class: CAUnion

Inherits:
CAStruct show all
Defined in:
lib/carray/struct.rb

Overview

Struct whose members all start at offset 0, so they are alternative readings of the same bytes. Otherwise behaves as a CAStruct.

Class Method Summary collapse

Methods inherited from CAStruct

#==, [], #[], #[]=, decode, #decode, #each, #each_pair, #encode, #eql?, field_info, fields, #hash, #initialize, #inspect, #length, members, #members, offset_of, size, spec, #spec, #swap_bytes, #swap_bytes!, #to_ptr, #values, #values_at

Constructor Details

This class inherits a constructor from CAStruct

Class Method Details

.inspectString

Returns the union's name, or "AnonUnion" when it was defined anonymously.

Returns:

  • (String)

    the union's name, or "AnonUnion" when it was defined anonymously.



518
519
520
# File 'lib/carray/struct.rb', line 518

def inspect
  return name.nil? ? "AnonUnion" : name
end