localshred/protobuf — pull request #134 by localshred (2013-11-14 20:46:27+00:00)
Title: Add enum alias support, refactor Enum class API

== Aliases

Extend Optionable module to get class-level option management. This
allows us to support the allow_alias protobuf option in libprotoc
v2.5.0.

Adds methods to return an array of EnumValue objects corresponding to a
given number "value".

== Enum API refactor

The term "value" is used to mean multiple things in the Enum
implementation:

1. An EnumValue object.
2. An integer commonly called a tag number.

This cut attempts to use the term "number" for arguments when the arg
should be number-like, and use the term `enum_value` in methods and
comments when we are referencing the actual object type. All method
name changes are aliased to their old names.

Ideally EnumValue would not be separate from Enum. I'm not willing to
make that cut here, possibly in a future API refactor cut.

== Documentation

Also part of this change is an attempt to provide documentation for the public method API on Enum. This is largely because it's difficult to peruse the code and know what things are doing (even for me being the maintainer). Eventually I'd like to have documentation coverage pervasive across the entire Protobuf gem API.