blob: b522ad8b018515f4d6d2526024274f95346971ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# Copyright © 2010 Julian Blake Kongslie <jblake@omgwallhack.org>
# Licensed under the BSD 3-clause license.
package Piny::User::IkiWiki;
use Moose;
use Moose::Util::TypeConstraints;
use Piny::User;
extends "Piny::User";
# Types
subtype 'IkiWikiUsername'
=> as 'Str'
=> where { $_ =~ /^ikiwiki-[a-zA-Z][a-zA-Z0-9_.-]*$/ }
=> message { 'That username is not in the correct format for an ikiwiki user.' }
;
# Attributes
has 'name' =>
( is => 'ro'
, isa => 'IkiWikiUsername'
, lazy_build => 1
);
# Moose boilerplate
__PACKAGE__->meta->make_immutable;
1;
|