Skip to content
Browse files

Added two methods for Local::AliasStatus

  • Loading branch information...
1 parent 681b462 commit 9d64be234d8d36be30caf7bd4b021a9bb17e4ab2 @mbethke committed Jul 20, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Ashafix/Model/Alias.pm
View
15 lib/Ashafix/Model/Alias.pm
@@ -17,4 +17,19 @@ package Ashafix::Model::Alias;
use Mojo::Base 'Ashafix::Model::Base';
+# Return a list of destination addresses for a given alias
+sub list_gotos {
+ my ($self, $alias) = @_;
+ return $self->schema('alias')->get_goto_by_address($alias)->flat;
+}
+
+# Return the subset of the 2 or 3 address arguments that exists as aliases
+sub get_address {
+ my $self = shift;
+ my $s = $self->schema('alias');
+ 2 == @_ and return $s->get_address_2(@_)->flat;
+ 3 == @_ and return $s->get_address_3(@_)->flat;
+ die "Ashafix::Model::Alias::get_address needs 2 or 3 arguments";
+}
+
1;

0 comments on commit 9d64be2

Please sign in to comment.
Something went wrong with that request. Please try again.