Changeset 16920

Show
Ignore:
Timestamp:
07/31/08 23:56:51 (5 years ago)
Author:
bonar
Message:

Class::Accessor to Class::Accessor::Fast, fix POD and some tests

Location:
lang/perl/Business-ISRC/trunk
Files:
1 added
9 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Business-ISRC/trunk/Makefile.PL

    r16900 r16920  
    66    VERSION_FROM      => 'lib/Business/ISRC.pm', 
    77    PREREQ_PM         => { 
    8         'Locale::Country' => 2.07, 
    9         'Class::Accessor' => 0.31, 
     8        'Locale::Country'       => 2.07, 
     9        'Class::Accessor::Fast' => 0.31, 
    1010    }, 
    1111    ($] >= 5.005 ? 
    1212      (ABSTRACT_FROM  => 'lib/Business/ISRC.pm', 
    13        AUTHOR         => 'nakano kyohei (bonar) bonar@me.com>') : ()), 
     13       AUTHOR         => 'nakano kyohei (bonar) <bonamonchy@gmail.com>') : ()), 
    1414); 
  • lang/perl/Business-ISRC/trunk/lib/Business/ISRC.pm

    r16900 r16920  
    55 
    66use Locale::Country qw/code2country/; 
    7 use base 'Class::Accessor'; 
     7use base 'Class::Accessor::Fast'; 
    88 
    99use overload '""' => 'as_default_string'; 
     
    103103 
    104104  # create object (validate string) 
    105   my $isrc = Business::ISRC->new("usl4q0702458"); 
    106   if (!defined $isrc) { 
    107       die "invalid isrc format"; 
    108   } 
     105  my $isrc = Business::ISRC->new("usl4q0702458") 
     106      or die "invalid isrc format"; 
    109107 
    110108  $isrc->country_code;    # US 
     
    122120=head1 DESCRIPTION 
    123121 
    124 This module provides data container for ISRC. ISRC is the unique code  
     122This module provides data container for ISRC. ISRC is an unique code  
    125123for identifying sound recordings and music videos internationally.  
    126124You can use this to validate or normalize ISRC strings. 
     
    133131=head2 ISRC FORMAT 
    134132 
    135   ISRC consists of five parts: 
     133ISRC string is made up for these five parts: 
    136134 
    137135  sample: US-L4Q-07-02458 
     
    145143=head1 ACCESSOR 
    146144 
    147 all fields are read-only. 
     145all accessors are created by mk_ro_accessors of Class::Accessor::Fast. 
     146so all fields are read-only. 
    148147 
    149     raw_string 
    150     country_code 
    151     country_name 
    152     registrant_code 
    153     year 
    154     designation_code 
     148  raw_string       # first argument of new() 
     149  country_code 
     150  country_name 
     151  registrant_code 
     152  year 
     153  designation_code 
     154 
     155you can get value like this: 
     156 
     157  my $rc = $isrc->registrant_code; 
    155158 
    156159=head1 METHOD 
     
    171174  ); 
    172175 
     176=head2 as_default_string() 
     177 
     178  same as as_string() with no option. 
     179 
    173180=head1 SEE ALSO 
    174181 
     
    177184=head1 AUTHOR 
    178185 
    179 Nakano Kyohei (bonar) E<lt>bonar@me.comE<gt> 
     186Nakano Kyohei (bonar) E<lt>bonamonchy@gmail.comE<gt> 
    180187 
    181188=head1 COPYRIGHT AND LICENSE 
  • lang/perl/Business-ISRC/trunk/t/00_load.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict; 
  • lang/perl/Business-ISRC/trunk/t/10_basic.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict; 
  • lang/perl/Business-ISRC/trunk/t/11_overload.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict; 
  • lang/perl/Business-ISRC/trunk/t/12_invalid.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict; 
  • lang/perl/Business-ISRC/trunk/t/20_normalize.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict; 
  • lang/perl/Business-ISRC/trunk/t/50_random.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict; 
  • lang/perl/Business-ISRC/trunk/t/98_critic.t

    r16900 r16920  
    1 #!/usr/bin/perl 
     1#!perl -T 
    22 
    33use strict;