![]() |
![]()
| ![]() |
![]()
NAMEMouseX::AttributeHelpers::Number SYNOPSISpackage Real; use Mouse; use MouseX::AttributeHelpers; has 'integer' => ( metaclass => 'Number', is => 'rw', isa => 'Int', default => 5, provides => { set => 'set', add => 'add', sub => 'sub', mul => 'mul', div => 'div', mod => 'mod', abs => 'abs', }, ); package main; my $real = Real->new; $real->add(5); # same as $real->integer($real->integer + 5); $real->sub(2); # same as $real->integer($real->integer - 2); DESCRIPTIONThis provides a simple numeric attribute, which supports most of the basic math operations. PROVIDERSsetaddsubmuldivmodabsMETHODSmethod_constructorshelper_typeAUTHORNAKAGAWA Masaki <masaki@cpan.org> LICENSEThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSOMouseX::AttributeHelpers, MouseX::AttributeHelpers::Base
|