select MAC Address display format on Node and Device Port search

This commit is contained in:
Oliver Gorwits
2013-04-24 22:18:04 +01:00
parent 558184d8ac
commit 8dca426e92
10 changed files with 65 additions and 5 deletions

View File

@@ -7,6 +7,8 @@ package App::Netdisco::DB::Result::NodeIp;
use strict;
use warnings;
use Net::MAC;
use base 'DBIx::Class::Core';
__PACKAGE__->table("node_ip");
__PACKAGE__->add_columns(
@@ -206,4 +208,12 @@ between the date stamp and time stamp. That is:
sub time_last_stamp { return (shift)->get_column('time_last_stamp') }
=head2 net_mac
Returns the C<mac> column instantiated into a L<Net::MAC> object.
=cut
sub net_mac { return Net::MAC->new(mac => (shift)->mac) }
1;