| 1 | ########################################################### | ||||||||||
| 2 | # SIOC::Space | ||||||||||
| 3 | # Space class for the SIOC ontology | ||||||||||
| 4 | ########################################################### | ||||||||||
| 5 | # | ||||||||||
| 6 | # $Id: Space.pm 10 2008-03-01 21:38:39Z geewiz $ | ||||||||||
| 7 | # | ||||||||||
| 8 | package SIOC::Space; | ||||||||||
| 9 | |||||||||||
| 10 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | our $VERSION = do { if (q$Revision: 10 $ =~ /Revision: (?:\d+)/mx) { sprintf "1.0-%03d", $1; }; }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | |||||||||||
| 15 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 4 | ▶ | use MooseX::AttributeHelpers; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 4 | extends 'SIOC'; | |||||||||
| 19 | |||||||||||
| 20 | ### optional attributes | ||||||||||
| 21 | |||||||||||
| 22 | 4 | has 'parent' => ( | |||||||||
| 23 | isa => 'SIOC::Space', | ||||||||||
| 24 | is => 'rw', | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | has 'space_of' => ( | ||||||||||
| 28 | metaclass => 'Collection::Array', | ||||||||||
| 29 | is => 'rw', | ||||||||||
| 30 | isa => 'ArrayRef[SIOC]', | ||||||||||
| 31 | 0 | ▶ | default => sub { [] }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 32 | 4 | provides => { | |||||||||
| 33 | 'push' => 'make_space_of', | ||||||||||
| 34 | }, | ||||||||||
| 35 | ); | ||||||||||
| 36 | |||||||||||
| 37 | has 'usergroups' => ( | ||||||||||
| 38 | isa => 'ArrayRef[SIOC::Usergroup]', | ||||||||||
| 39 | metaclass => 'Collection::Array', | ||||||||||
| 40 | is => 'rw', | ||||||||||
| 41 | 0 | ▶ | default => sub { [] }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 42 | 4 | provides => { | |||||||||
| 43 | 'push' => 'add_usergroup', | ||||||||||
| 44 | }, | ||||||||||
| 45 | ); | ||||||||||
| 46 | |||||||||||
| 47 | ### methods | ||||||||||
| 48 | |||||||||||
| 49 | 0 | ▶ | after 'fill_template' => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 50 | 0 | my ($self) = @_; | |||||||||
| 51 | |||||||||||
| 52 | 0 | $self->set_template_var(parent => $self->parent); | |||||||||
| 53 | 0 | $self->set_template_var(usergroups => $self->usergroups); | |||||||||
| 54 | 0 | $self->set_template_var(space_of => $self->space_of); | |||||||||
| 55 | 4 | }; | |||||||||
| 56 | |||||||||||
| 57 | 4 | 1; | |||||||||
| 58 | __END__ | ||||||||||