module Protobuf module Descriptor class FileDescriptor class < mod end proto.enum_type.each do |enum_proto| Protobuf::Enum.descriptor.build enum_proto, :module => mod end end def unbuild(messages) messages = [messages] unless messages.is_a? Array proto = Google::Protobuf::FileDescriptorProto.new proto.package = messages.first.to_s.split('::')[0..-2].join('::') if messages.first.to_s =~ /::/ messages.each do |message| message.descriptor.unbuild proto end proto end end end end end