次の形式をとる複数の BinData レコードがある場合、いくつかの例を次に示します。
class DebugInfo < BinData::Record
endian :little
int32 :num
array :data, :type => :debug_log, initial_length: :num
end
class GoalInfo < BinData::Record
endian :little
int32 :num
array :data, :type => :goal, initial_length: :num
end
class PackageInfo < BinData::Record
endian :little
int32 :num
array :data, :type => :package, initial_length: :num
end
これらはすべて基本的に同じで、異なるタイプのオブジェクトを使用して配列を作成するだけです。これらのいずれかを作成し、何らかの形でオブジェクトのタイプを配列に読み込む方法はありますか?