samuraisam/p6-pb — pull request #2 by samuraisam (2014-07-06 01:21:47+00:00)
Title: WIP: Enum Generation

Hey @japhb I've some recent tuits and was working on my RethinkDB library again. Wanted to add Enum generation but I see you greatly embellished this module, and wanted your feedback on this first. You can see some of my commented out code which was failing strangely. Unfortunately by doing this there are no method names, but it works. In my RethinkDB library I can use a module like this:

```perl
module RethinkDB::Proto {
use PB::Model::Generator FN;

class RethinkDB::Proto::VersionDummy is VersionDummy {}

class RethinkDB::Proto::Query is Query {}

class RethinkDB::Proto::Frame is Frame {}

class RethinkDB::Proto::Backtrace is Backtrace {}

class RethinkDB::Proto::Response is Response {}

class RethinkDB::Proto::Datum is Datum {}

class RethinkDB::Proto::Term is Term {}
}
```

Then in another package do this:

```perl
use RethinkDB::Proto;
say RethinkDB::Response.ResponseType.SUCCESS_ATOM; # prints "1"
```

Which works for my use cases of needing to get at the enums.