Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
generate a little less code in Mojo::Base
  • Loading branch information
kraih committed Mar 22, 2015
1 parent ed5556c commit 89d2696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojo/Base.pm
Expand Up @@ -54,7 +54,7 @@ sub attr {
Carp::croak qq{Attribute "$attr" invalid} unless $attr =~ /^[a-zA-Z_]\w*$/;

# Header (check arguments)
my $code = "package $class;\nsub $attr {\n if (\@_ == 1) {\n";
my $code = "sub ${class}::$attr {\n if (\@_ == 1) {\n";

# No default value (return value)
unless (defined $default) { $code .= " return \$_[0]{'$attr'};" }
Expand Down

0 comments on commit 89d2696

Please sign in to comment.