I'm trying to convert this code:
#pragma once
#include "thread.h"
#include <vector>
struct Process {
enum Type {
SYSTEM,
USER
};
// process ID
int pid;
// process type
Type type;
// threads belonging to this process
std::vector<Thread*> threads;
// constructor
Process(int pid, Type type) : pid(pid), type(type) {}
};
into Ruby, but I can't figure it out. I've tried using a module, but found out you can't really have constructors in a Module. I don't really understand the ruby struct class either. If somebody could either explain these or help me convert it, it would be much appreciated.