[Bps-public-commit] r15659 - in Prophet/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Fri Aug 29 20:17:02 EDT 2008
Author: sartak
Date: Fri Aug 29 20:17:01 2008
New Revision: 15659
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/lib/Prophet/Config.pm
Prophet/trunk/lib/Prophet/Replica.pm
Log:
r70720 at onn: sartak | 2008-08-29 20:16:14 -0400
Add a display_id method to config for doing display-uuid mappings
Modified: Prophet/trunk/lib/Prophet/Config.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Config.pm (original)
+++ Prophet/trunk/lib/Prophet/Config.pm Fri Aug 29 20:17:01 2008
@@ -74,6 +74,14 @@
}
}
+sub display_id {
+ my $self = shift;
+ my $uuid = shift;
+
+ my $friendly = $self->config->get("display_$uuid");
+ return defined($friendly) ? $friendly : $uuid;
+}
+
__PACKAGE__->meta->make_immutable;
no Moose;
@@ -130,5 +138,9 @@
List all configuration options
+=head2 display_id UUID
+
+Returns a "friendly" id for the given uuid.
+
=cut
Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica.pm Fri Aug 29 20:17:01 2008
@@ -1123,7 +1123,7 @@
sub display_id {
my $self = shift;
- return $self->uuid;
+ return $self->app_handle->config->display_id($self->uuid);
}
__PACKAGE__->meta->make_immutable;
More information about the Bps-public-commit
mailing list