[Moose-commits] r7163 - in Mouse/trunk: . lib/Mouse/Meta
t/800_shikabased
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Mon Dec 22 04:06:32 GMT 2008
Author: sartak
Date: 2008-12-21 20:06:32 -0800 (Sun, 21 Dec 2008)
New Revision: 7163
Modified:
Mouse/trunk/
Mouse/trunk/lib/Mouse/Meta/Attribute.pm
Mouse/trunk/t/800_shikabased/008-create_class.t
Log:
r77773 at onn: sartak | 2008-12-21 23:06:24 -0500
Same API as Moose for Mouse::Meta::Attribute->new
Property changes on: Mouse/trunk
___________________________________________________________________
Name: svk:merge
- 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77771
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
+ 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77773
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
Modified: Mouse/trunk/lib/Mouse/Meta/Attribute.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Attribute.pm 2008-12-22 04:00:38 UTC (rev 7162)
+++ Mouse/trunk/lib/Mouse/Meta/Attribute.pm 2008-12-22 04:06:32 UTC (rev 7163)
@@ -7,17 +7,16 @@
use Scalar::Util ();
sub new {
- my $class = shift;
- my %args = @_;
+ my ($class, $name, %options) = @_;
- my $name = $args{name};
+ $options{name} = $name;
- $args{init_arg} = $name
- unless exists $args{init_arg};
+ $options{init_arg} = $name
+ unless exists $options{init_arg};
- $args{is} ||= '';
+ $options{is} ||= '';
- bless \%args, $class;
+ bless \%options, $class;
}
sub name { $_[0]->{name} }
@@ -232,7 +231,7 @@
$args{find_type_constraint} = $code;
}
- my $attribute = $self->new(%args);
+ my $attribute = $self->new($name, %args);
$attribute->_create_args(\%args);
Modified: Mouse/trunk/t/800_shikabased/008-create_class.t
===================================================================
--- Mouse/trunk/t/800_shikabased/008-create_class.t 2008-12-22 04:00:38 UTC (rev 7162)
+++ Mouse/trunk/t/800_shikabased/008-create_class.t 2008-12-22 04:06:32 UTC (rev 7163)
@@ -42,7 +42,10 @@
superclasses => [ "FooBar", "Mouse::Object" ],
attributes => [
Mouse::Meta::Attribute->new(
- name => "foo", is => "rw", default => "yay"
+ "foo" => (
+ is => "rw",
+ default => "yay",
+ ),
)
],
methods => {
More information about the Moose-commits
mailing list