use Moose;
extends 'Moose::Meta::Attribute';
+# This doesn't actually do anything because _process_options does not consult
+# the default value of "is". hrm.
+has '+is' => (
+ default => 'ro',
+);
+
+around _process_options => sub {
+ my $orig = shift;
+ my ($class, $name, $options) = @_;
+
+ $options->{is} ||= 'ro';
+
+ $orig->(@_);
+};
__PACKAGE__->meta->make_immutable(
inline_constructor => 1,
use MooseX::Role::Parameterized;
parameter length => (
- is => 'ro',
isa => 'Int',
required => 1,
);
($parameters, %args) = @_;
has age => (
- is => 'ro',
default => $parameters->default_age,
);
use Moose::Util::TypeConstraints;
parameter format => (
- is => 'ro',
isa => (enum ['Dumper', 'Storable']),
required => 1,
);
parameter freeze_method => (
- is => 'ro',
isa => 'Str',
lazy => 1,
default => sub { "freeze_" . shift->format },
);
parameter thaw_method => (
- is => 'ro',
isa => 'Str',
lazy => 1,
default => sub { "thaw_" . shift->format },
use MooseX::Role::Parameterized;
parameter slot => (
- is => 'ro',
isa => 'Str',
required => 1,
);
use MooseX::Role::Parameterized;
parameter slot => (
- is => 'ro',
isa => 'Str',
required => 1,
);
use MooseX::Role::Parameterized;
parameter method => (
- is => 'ro',
isa => 'Str',
required => 1,
);
use MooseX::Role::Parameterized;
parameter attribute => (
- is => 'ro',
isa => 'Str',
);