Changeset 8664

Show
Ignore:
Timestamp:
04/02/08 19:10:04 (5 years ago)
Author:
tokuhirom
Message:

なんでメソッド名をわたそうと思ったんだろう。俺。Hook と してるよ。あんた。

Location:
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Attribute/MobileMethod.pm

    r8662 r8664  
    55 
    66sub register { 
    7     my ( $class, $plugin, $c, $method, $parameter, $code ) = @_; 
    8     $parameter =~ s/\s*//g; 
    9     my ($meth, $carrier ) = split /,/, $parameter; 
     7    my ( $class, $plugin, $c, $method, $carrier, $code ) = @_; 
     8 
    109    if ($c->carrier_longname eq $carrier) { 
    11         $c->register_method( $meth => $plugin ); 
     10        $c->register_method( $method => $plugin ); 
    1211    } 
    1312} 
     
    1918=head1 SYNOPSIS 
    2019 
    21     sub foo : MobileMethod('html_version,DoCoMo') { 
     20    sub foo : MobileMethod('DoCoMo') { 
    2221        # your codes here 
    2322    } 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/AirHPhone.pm

    r8662 r8664  
    1111 
    1212for my $method (qw(name vendor model model_version browser_version cache_size)) { 
    13     eval qq! sub $method :MobileMethod("$method,AirHPhone") { shift->{$method} }; !; ## no critic. 
     13    eval qq! sub $method :MobileMethod("AirHPhone") { shift->{$method} }; !; ## no critic. 
    1414    die $@ if $@; 
    1515} 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/DoCoMo.pm

    r8662 r8664  
    1515# FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。 
    1616for my $method (qw/version model status bandwidth serial_number is_foma card_id xhtml_compliant comment/) { 
    17     eval qq! sub $method :MobileMethod("$method,DoCoMo") { shift->{$method} }; !; ## no critic. 
     17    eval qq! sub $method :MobileMethod('DoCoMo') { shift->{$method} }; !; ## no critic. 
    1818    die $@ if $@; 
    1919} 
    2020 
    21 sub name : MobileMethod('name,DoCoMo') { shift->{name} } 
     21sub name : MobileMethod('DoCoMo') { shift->{name} } 
    2222 
    23 sub cache_size :MobileMethod('cache_size,DoCoMo') { 
     23sub cache_size :MobileMethod('DoCoMo') { 
    2424    my $self = shift; 
    2525    return $self->{cache_size} || $DefaultCacheSize; 
    2626} 
    2727 
    28 sub series :MobileMethod('series,DoCoMo') { 
     28sub series :MobileMethod('DoCoMo') { 
    2929    my $self  = shift; 
    3030    my $model = $self->model; 
     
    3838} 
    3939 
    40 sub vendor :MobileMethod('vendor,DoCoMo') { 
     40sub vendor :MobileMethod('DoCoMo') { 
    4141    my $self  = shift; 
    4242    my $model = $self->model; 
     
    5757]; 
    5858 
    59 sub html_version: MobileMethod('html_version,DoCoMo') { 
     59sub html_version: MobileMethod('DoCoMo') { 
    6060    my ($self, $c) = @_; 
    6161 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/EZweb.pm

    r8662 r8664  
    1313# FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。 
    1414for my $method (qw(name version model device_id server xhtml_compliant comment)) { 
    15     eval qq! sub $method :MobileMethod("$method,EZweb") { shift->{$method} }; !; ## no critic. 
     15    eval qq! sub $method :MobileMethod("EZweb") { shift->{$method} }; !; ## no critic. 
    1616    die $@ if $@; 
    1717} 
    1818 
    19 sub is_tuka : MobileMethod('is_tuka,EZweb') { 
     19sub is_tuka : MobileMethod('EZweb') { 
    2020    my $self = shift; 
    2121    my $tuka = substr( $self->device_id, 2, 1 ); 
     
    2929} 
    3030 
    31 sub is_win : MobileMethod('is_win,EZweb') { 
     31sub is_win : MobileMethod('EZweb') { 
    3232    my $self = shift; 
    3333    my $win = substr( $self->device_id, 2, 1 ); 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/NonMobile.pm

    r8663 r8664  
    44use base qw/Class::Component::Plugin/; 
    55 
    6 sub model           :MobileMethod('model,NonMobile') { '' } 
    7 sub device_id       :MobileMethod('device_id,NonMobile') { '' } 
    8 sub xhtml_compliant :MobileMethod('xhtml_compliant,NonMobile') { 1 } 
     6sub model           :MobileMethod('NonMobile') { '' } 
     7sub device_id       :MobileMethod('NonMobile') { '' } 
     8sub xhtml_compliant :MobileMethod('NonMobile') { 1 } 
    99 
    10101; 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/ThirdForce.pm

    r8662 r8664  
    1313# FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。 
    1414for my $method (qw(name version model type packet_compliant serial_number vendor vendor_version java_info)) { 
    15     eval qq! sub $method :MobileMethod("$method,ThirdForce") { shift->{$method} }; !; ## no critic. 
     15    eval qq! sub $method :MobileMethod("ThirdForce") { shift->{$method} }; !; ## no critic. 
    1616    die $@ if $@; 
    1717} 
    1818 
    19 sub is_type_c   :MobileMethod('is_type_c,ThirdForce')   { shift->{type} =~ /^C/ } 
    20 sub is_type_p   :MobileMethod('is_type_p,ThirdForce')   { shift->{type} =~ /^P/ } 
    21 sub is_type_w   :MobileMethod('is_type_w,ThirdForce')   { shift->{type} =~ /^W/ } 
    22 sub is_type_3gc :MobileMethod('is_type_3gc,ThirdForce') { shift->{type} eq '3GC' } 
     19sub is_type_c   :MobileMethod('ThirdForce')   { shift->{type} =~ /^C/ } 
     20sub is_type_p   :MobileMethod('ThirdForce')   { shift->{type} =~ /^P/ } 
     21sub is_type_w   :MobileMethod('ThirdForce')   { shift->{type} =~ /^W/ } 
     22sub is_type_3gc :MobileMethod('ThirdForce') { shift->{type} eq '3GC' } 
    2323 
    24 sub xhtml_compliant :MobileMethod('xhtml_compliant,ThirdForce') { 
     24sub xhtml_compliant :MobileMethod('ThirdForce') { 
    2525    my $self = shift; 
    2626    return ( $self->is_type_w || $self->is_type_3gc ) ? 1 : 0; 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/GPS.pm

    r8638 r8664  
    66our $DoCoMoGPSModels = { map { $_ => 1 } qw(F661i F505iGPS) }; 
    77 
    8 sub is_gps : MobileMethod('is_gps,DoCoMo') { 
     8sub is_gps : MobileMethod('DoCoMo') { 
    99    my ($self, $c) = @_; 
    1010    return exists $DoCoMoGPSModels->{ $c->model };