Commits

Konstantin Baierer committed 4ccc0b6

docs, test for is_auto_generated

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' );
 
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.