[Nitro] Error handling in ann_attr

Judson Lester nyarly at gmail.com
Fri Feb 9 03:30:18 EST 2007


On 2/8/07, transfire at gmail.com <transfire at gmail.com> wrote:
> Appearently Og is still using that old missing_constant return symbol
> trick! The idea is that it allows you to define a model prior to the
> actual constant being defined. Clever, but as you have now discovered
> this is TOO magical and no longer even works with the new
> implementation of annotated attrs. If there is the chance that the
> constant will not be defined before your model needs it then use the
> equivalent full spec:
>
>   attr_accessor :response, :class => :HTTPResponse
>
> That should work (if not it's a bug that needs to be fixed).

It is a bug that needs to be fixed: should have been Net::HTTPResponse.

I do like the ability to omit the "class ComingSoon; end" malarkey,
but I wonder if there isn't a way to guarantee that those missing
constants actually become classes eventually.


More information about the Nitro-general mailing list