| 1 | ########################################################### | ||
| 2 | # SIOC::Usergroup | ||
| 3 | # Usergroup class for the SIOC ontology | ||
| 4 | ########################################################### | ||
| 5 | # | ||
| 6 | # $Id: Usergroup.pm 10 2008-03-01 21:38:39Z geewiz $ | ||
| 7 | # | ||
| 8 | |||
| 9 | package SIOC::Usergroup; | ||
| 10 | |||
| 11 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 3 | ▶ | use version; our $VERSION = qv(1.0.0); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | 3 | extends 'SIOC'; | |
| 19 | |||
| 20 | ### required attributes | ||
| 21 | |||
| 22 | has members => ( | ||
| 23 | isa => 'ArrayRef[SIOC::User]', | ||
| 24 | metaclass => 'Collection::Array', | ||
| 25 | is => 'rw', | ||
| 26 | 0 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 27 | 3 | provides => { | |
| 28 | 'push' => 'add_member', | ||
| 29 | }, | ||
| 30 | required => 1, | ||
| 31 | ); | ||
| 32 | |||
| 33 | ### optional attributes | ||
| 34 | |||
| 35 | # parent space | ||
| 36 | has 'spaces' => ( | ||
| 37 | isa => 'ArrayRef[SIOC::Space]', | ||
| 38 | metaclass => 'Collection::Array', | ||
| 39 | is => 'rw', | ||
| 40 | 0 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 41 | 3 | provides => { | |
| 42 | 'push' => 'add_space', | ||
| 43 | }, | ||
| 44 | ); | ||
| 45 | |||
| 46 | ### methods | ||
| 47 | |||
| 48 | 0 | ▶ | after 'fill_template' => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 49 | 0 | my ($self) = @_; | |
| 50 | |||
| 51 | 0 | $self->set_template_var(members => $self->members); | |
| 52 | 0 | $self->set_tempalte_var(space => $self->space); | |
| 53 | 3 | }; | |
| 54 | |||
| 55 | ### EOC | ||
| 56 | |||
| 57 | 3 | 1; | |
| 58 | __END__ | ||