1 package SGN
::SiteFeatures
::CrossReference
;
3 use namespace
::autoclean
;
5 use MooseX
::Types
::URI
'Uri';
7 has
'url' => ( documentation
=> <<'',
8 the absolute
or relative URL where the full resource can be accessed
, e
.g
. /unigenes/search
.pl?q
=SGN
-U12
17 has
'text' => ( documentation
=> <<'',
18 a short text description of the contents of the resource referenced
, for example
"6 SGN Unigenes"
26 has
'is_empty' => ( documentation
=> <<'',
27 true
if the cross reference is empty
, may be used as a rendering hint
34 has
'feature' => ( documentation
=> <<'',
35 the site feature object this cross reference points to
41 has
'renderings' => ( documentation
=> <<'',
42 2-level hashref of suggested renderings
, keyed first by content type
, then rendering hint
46 default => sub { +{} },
53 feature
=> $self->feature->feature_name,
54 map { $_ => $self->$_() }
55 qw( url is_empty text renderings )
61 no warnings
'uninitialized';
63 $a->feature->feature_name cmp $b->feature->feature_name
64 || $a->is_empty <=> $b->is_empty
65 || $a->text cmp $b->text
66 || $a->url.'' cmp $b->url.'';
72 no warnings
'uninitialized';
73 return !($a->is_empty xor $b->is_empty)
74 && $a->text eq $b->text
75 && $a->url.'' eq $b->url.''
76 && $a->feature->feature_name eq $b->feature->feature_name;
81 grep !$seen{ _uniq_str
($_) }++, @_;
86 $self->feature->feature_name,