| 1 | package JavaScript::Code::Number; | ||
| 2 | |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use vars qw[ $VERSION ]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | use base | ||
| 6 | 2 | ▶ | qw[ JavaScript::Code::Type JavaScript::Code::Expression::Node::Arithmetic ]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | $VERSION = '0.08'; | |
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | JavaScript::Code::Number - A JavaScript Number Type | ||
| 13 | |||
| 14 | =head1 SYNOPSIS | ||
| 15 | |||
| 16 | #!/usr/bin/perl | ||
| 17 | |||
| 18 | use strict; | ||
| 19 | use warnings; | ||
| 20 | use JavaScript::Code::Number; | ||
| 21 | |||
| 22 | my $number = JavaScript::Code::String->new( value => 42 ); | ||
| 23 | |||
| 24 | print $number->output; | ||
| 25 | |||
| 26 | =head1 METHODS | ||
| 27 | |||
| 28 | See also the L<JavaScript::Code::Type> documentation. | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | =head2 $self->type( ) | ||
| 33 | |||
| 34 | =cut | ||
| 35 | |||
| 36 | 0 | ▶ | sub type { |
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 37 | 0 | return "Number"; | |
| 38 | } | ||
| 39 | |||
| 40 | =head2 $self->output( ) | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | 2 | ▶ | sub output { |
|
Subroutine
output: called CC=1 SCAR=0.0
Pod
documented
| |||
| 45 | 2 | my ($self) = @_; | |
| 46 | |||
| 47 | 2 | my $value = $self->value; | |
| 48 | 2 | $value += 0; # make sure it is a number | |
| 49 | |||
| 50 | 2 | return "$value"; | |
| 51 | } | ||
| 52 | |||
| 53 | =head1 SEE ALSO | ||
| 54 | |||
| 55 | L<JavaScript::Code> | ||
| 56 | |||
| 57 | =head1 AUTHOR | ||
| 58 | |||
| 59 | Sascha Kiefer, C<esskar@cpan.org> | ||
| 60 | |||
| 61 | =head1 LICENSE | ||
| 62 | |||
| 63 | This library is free software, you can redistribute it and/or modify it under | ||
| 64 | the same terms as Perl itself. | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | 2 | 1; | |