If have multiple BinData Records that take the following form, here are a few examples:
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
All of these are essentially the same, they just make an array using different types of objects. Is there a way to just make one of these and somehow pass it the type of object I want it to read into the array?