class BinData::Struct

def clear(name = nil)

is given, clears all fields in the struct.
Clears the field represented by +name+. If no +name+
def clear(name = nil)
  if name.nil?
    @field_objs.each { |f| f.clear unless f.nil? }
  else
    obj = find_obj_for_name(name.to_s)
    obj.clear unless obj.nil?
  end
end