summaryrefslogtreecommitdiff
path: root/lib/Net/HTTP/Console/Role/Prompt.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net/HTTP/Console/Role/Prompt.pm')
-rw-r--r--lib/Net/HTTP/Console/Role/Prompt.pm20
1 files changed, 20 insertions, 0 deletions
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;