Commits

Konstantin Baierer committed 4ccc0b6

docs, test for is_auto_generated

  • Participants
  • Parent commits 05b0f42

Comments (0)

Files changed (2)

lib/MooseX/Semantic/Role/Resource.pm

     lazy => 1,
     builder => '_build_rdf_about',
     handles => [qw( is_blank is_resource )],
+    trigger => sub {
+        my $self = shift;
+        $self->_is_auto_generated(undef);
+    },
 );
 sub _build_rdf_about {
     my $self = shift;
     default => 0,
     lazy => 1,
 );
-
 sub is_auto_generated {
     my $self = shift;
     # make sure rdf_about has been initialized lazily
 
 =cut
 
+=head2 C<is_auto_generated>
+
+Returns true value if the 'rdf_about' attribute was aut-generated, false if it
+has been explicitly set (at constructor time or using the 'rdf_about' accessor)
+
+=cut
+
 =head1 AUTHOR
 
 Konstantin Baierer (<kba@cpan.org>)
 # warn Dumper $t->rdf_about;
 ok( $t1->is_auto_generated, 't1 has auto-generated ID' );
 ok( ! $t2->is_auto_generated, 't1 has explicit rdf_about' );
+$t1->rdf_about('bar');
+ok( ! $t1->is_auto_generated, 'Now t1 has explicit rdf_about' );