4 use namespace
::autoclean
;
7 use MooseX
::Types
::Path
::Class
'Dir';
12 documentation
=> 'our context class',
15 does
=> 'SGN::Role::Site::SiteFeatures',
20 documentation
=> 'boolean flag, whether this feature is enabled',
29 my $name = ref( $self ) || $self;
34 has
'description' => (
35 documentation
=> <<'',
36 short plaintext description of the feature
, user
-visible
. May be used
in default views
for crossreferences
and so forth
.
40 default => sub { ucfirst shift->feature_name },
43 has
'feature_dir' => (
48 ); sub _build_feature_dir
{
50 return $self->context->path_to( 'features', $self->feature_name )->stringify;
55 return File
::Spec
->catfile( $self->feature_dir, @_ );
60 return $self->context->tempfiles_base->subdir( 'features', $self->feature_name );
63 # called on application restart
67 # return one or more SGN::SiteFeature::CrossReference objects for the
68 # given input (input can be anything) or nothing if the query is not
69 # handled by this Feature. note that a CrossReference object should
70 # always be returned, it just might be empty
78 __PACKAGE__
->meta->make_immutable;