15 package MooseX::SomeAwesomeDBFields;
17 # implementation of methods not called in the example deliberately
22 sub inline_create_instance {
23 my ( $self, $classvar ) = @_;
25 "bless SomeAwesomeDB::new_row(), $classvar";
28 sub inline_get_slot_value {
29 my ( $self, $invar, $slot ) = @_;
31 "SomeAwesomeDB::read($invar, \"$slot\")";
34 sub inline_set_slot_value {
35 my ( $self, $invar, $slot, $valexp ) = @_;
37 "SomeAwesomeDB::write($invar, \"$slot\", $valexp)";
40 sub inline_is_slot_initialized {
41 my ( $self, $invar, $slot ) = @_;
46 sub inline_initialize_slot {
47 my ( $self, $invar, $slot ) = @_;
52 sub inline_slot_access {
53 die "inline_slot_access should not have been used";
61 use Moose::Util::MetaRole;
66 Moose::Util::MetaRole::apply_metaroles(
68 class_metaroles => { instance => ['MooseX::SomeAwesomeDBFields'] },
79 "Adding lazy accessor does not use inline_slot_access";
86 "Adding read-write accessor does not use inline_slot_access";
88 lives_ok { __PACKAGE__->meta->make_immutable; }
89 "Inling constructor does not use inline_slot_access";