Changeset 8672
- Timestamp:
- 04/02/08 20:34:30 (5 years ago)
- Location:
- lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute
- Files:
-
- 2 modified
-
Plugin.pm (modified) (1 diff)
-
Plugin/Default/DoCoMo.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin.pm
r8668 r8672 3 3 use warnings; 4 4 use base qw/Class::Component::Plugin/; 5 6 sub mk_register_accessors { 7 my $self = shift; 8 my $c = shift; 9 my $class = ref $self; 10 11 for my $method (@_) { 12 no strict 'refs'; 13 *{"$class\::$method"} = sub { shift->{$method} } unless *{"$class\::$method"}{CODE}; 14 $c->register_method( $method => $self ); 15 } 16 } 5 17 1; -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/DoCoMo.pm
r8668 r8672 9 9 my ( $self, $c ) = @_; 10 10 return unless $c->carrier_longname eq 'DoCoMo'; 11 $self->mk_register_accessors( $c => qw/version model status bandwidth serial_number is_foma card_id xhtml_compliant comment/); 11 12 12 13 $self->parse( $c ); 13 14 } 14 15 15 # FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。16 for my $method (qw/version model status bandwidth serial_number is_foma card_id xhtml_compliant comment/) {17 eval qq! sub $method :MobileMethod('DoCoMo') { shift->{$method} }; !; ## no critic.18 die $@ if $@;19 }20 16 21 17 sub name : MobileMethod('DoCoMo') { shift->{name} }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)