Class: CAUnion
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
-
.inspect ⇒ String
The union's name, or
"AnonUnion"when it was defined anonymously.
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
.inspect ⇒ String
Returns 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 |