List Info

Thread: Re: Attribute::Handlers wont work in own classes under catalyst




Re: Attribute::Handlers wont work in own classes under catalyst
country flaguser name
United States
2007-08-29 13:11:37
Felix Antonius Wilhelm Ostmann wrote:
> we have build some classes with Attribute::Handlers
(was inspired from 
> Attribute::Property)
> 
> This works realy fine!
> 
> after a few tests we gone use this classes under
catalyst ... and ... 
> dont work :-/ under catalyst our classes dont use
Attribute::Handlers 
> :-/ we declare UNIVERSAL::Property and then use
"sub nondigit : Property 
> { defined && !m{[0-9]} }" (see the code)
> 
> then you can call: $obj->nondigit(4) and it will
croak or 
> $obj->nondigit("car") and it will set the
object-property nondigit to 
> "car".

I'm gonna stop right here because it seems like you're
trying to 
re-invent Moose in some round-about way.

Take a look at the simple "Point" example [1] plus
the docs for 
TypeConstraints [2].

I'd trying to help with your existing code, but it makes my
eyes bleed. 

-Brian

[1] http://search.cpan.org/~stevan/Moose-0.2
5/lib/Moose/Cookbook/Recipe1.pod
[2] 
http://search.cpan.org/~stevan/Moose-
0.25/lib/Moose/Util/TypeConstraints.pm

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )