$options->{accessor} ||= $name;
}
}
+ elsif ($options->{is} eq 'bare') {
+ # do nothing, but don't complain (later) about missing methods
+ }
else {
$class->throw_error("I do not understand this option (is => " . $options->{is} . ") on attribute ($name)", data => $options->{is});
}
} '... the attribute metaclass alias worked correctly';
::lives_ok {
- has 'bar' => (metaclass => 'Bar');
+ has 'bar' => (metaclass => 'Bar', is => 'bare');
} '... the attribute metaclass alias worked correctly';
}
has 'one_last_one' => (is => 'rw', isa => 'Ref');
# this one will work here ....
- has 'fail' => (isa => 'CodeRef');
- has 'other_fail';
+ has 'fail' => (isa => 'CodeRef', is => 'bare');
+ has 'other_fail' => (is => 'bare');
package Bar;
use Moose;
documentation => q{
The 'foo' attribute is my favorite
attribute in the whole wide world.
- }
+ },
+ is => 'bare',
);
}
use Moose;
}
-lives_ok { OutOfClassTest::has('foo'); } 'create attr via direct sub call';
-lives_ok { OutOfClassTest->can('has')->('bar'); } 'create attr via can';
+lives_ok { OutOfClassTest::has('foo', is => 'bare'); } 'create attr via direct sub call';
+lives_ok { OutOfClassTest->can('has')->('bar', is => 'bare'); } 'create attr via can';
ok(OutOfClassTest->meta->get_attribute('foo'), 'attr created from sub call');
ok(OutOfClassTest->meta->get_attribute('bar'), 'attr created from can');
has 'bar' => (
metaclass => 'Bar::Meta::Attribute',
- my_legal_option => sub { 'Bar' }
+ my_legal_option => sub { 'Bar' },
+ is => 'bare',
);
package Bar::B;
},
},
],
+ is => 'bare',
);
}
},
},
],
+ is => 'bare',
);
}
for (1..3) {
has "err$_" => (
isa => 'Str | Int',
+ is => 'bare',
);
}
has age => (
isa => 'Positive',
+ is => 'bare',
);
}
has age => (
isa => 'Negative',
+ is => 'bare',
);
}
MooseAlike1->import();
- ::lives_ok( sub { has( 'size' ) },
+ ::lives_ok( sub { has( 'size', is => 'bare' ) },
'has was exported via MooseAlike1' );
MooseAlike1->unimport();
MooseAlike2->import();
- ::lives_ok( sub { has( 'size' ) },
+ ::lives_ok( sub { has( 'size', is => 'bare' ) },
'has was exported via MooseAlike2' );
MooseAlike2->unimport();
package Foo;
use Moose;
- has 'foo';
+ has 'foo', is => 'bare';
}
{
extends 'Foo';
- has 'bar';
+ has 'bar', is => 'bare';
}
my %trustme = (
'Moose' => ['make_immutable'],
- 'Moose::Meta::Attribute' => [ 'interpolate_class', 'throw_error' ],
+ 'Moose::Meta::Attribute' => [
+ qw( interpolate_class
+ throw_error
+ attach_to_class
+ )
+ ],
'Moose::Meta::Class' => [
qw( check_metaclass_compatibility
construct_instance