zendesk/zendesk_api_client_rb — pull request #185 by gabetax (2014-08-20 22:01:13+00:00)
Title: Use an explicit DataNamespace class for Data/Resource objects

Currently there is only the "Voice" namespace used in the public gem. References to this namespace are hard coded in the client (for resolving `client.phone_numbers` type queries) and path building (to deal with nested resources). If we want to add extra namespaces, especially internally, it requires manually updating these two hard-coded lists. By making Data namespaces explicit by using a polymorphic class instead of a module, we have an implicit registry of namespaces available to us. It also allows for future behavior changes, such as specifying path components in the DataNamespace directly instead of in the Resource via `namespace` call.

/cc @steved555 @osheroff @yadavsaroj

### Risks

By changing `ZendeskAPI::Voice` from a module to a namespace, this could cause a `TypeError: Voice is not a module` for anyone that is monkey patching these classes in their own application. Ideally developers **should not** monkey patch classes they don't own, and **should** rather use something like a decorator.