From 78fcbf54a4305e1ee6c3a105f91af40c7ea0a62a Mon Sep 17 00:00:00 2001 From: franck cuny Date: Tue, 8 Jun 2010 15:22:36 +0200 Subject: switch to MX::Declare; rename some roles and dispatcher --- lib/Net/HTTP/Console/Role/Prompt.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/Net/HTTP/Console/Role/Prompt.pm (limited to 'lib/Net/HTTP/Console/Role/Prompt.pm') diff --git a/lib/Net/HTTP/Console/Role/Prompt.pm b/lib/Net/HTTP/Console/Role/Prompt.pm new file mode 100644 index 0000000..b6a9599 --- /dev/null +++ b/lib/Net/HTTP/Console/Role/Prompt.pm @@ -0,0 +1,20 @@ +package Net::HTTP::Console::Role::Prompt; + +use MooseX::Declare; + +role Net::HTTP::Console::Role::Prompt { + + has prompt => ( + isa => 'Str', + is => 'rw', + lazy => 1, + default => sub { + my $self = shift; + my $url = $self->api_object->api_base_url; + return ($url || '[no url defined!]') . '> '; + } + ); + +} + +1; -- cgit v1.2.3