delete fees, RT#81713
[freeside.git] / FS / FS / MAC_Mixin.pm
1 package FS::MAC_Mixin;
2
3 use strict;
4 #use FS::Record qw(qsearch);
5 #use FS::Conf;
6 # careful about importing anything here--it will end up in a LOT of 
7 # namespaces
8
9 #use vars qw(@subclasses $DEBUG $conf);
10
11 #$DEBUG = 0;
12
13 # any subclass that can have MAC addresses needs to be added here
14 #@subclasses = (qw(FS::svc_broadband FS::svc_cable));
15
16 #sub conf {
17 #  $conf ||= FS::Conf->new;
18 #}
19
20 =head1 NAME
21
22 FS::MAC_Mixin - Mixin class for objects that have MAC addresses assigned.
23
24 =head1 SYNOPSIS
25
26 =head1 DESCRIPTION
27
28 =head1 METHODS
29
30 =head1 METHODS
31
32 =over 4
33
34 =item mac_addr_pretty
35
36 =cut
37
38 sub mac_addr_pretty {
39   my $self = shift;
40   $self->mac_addr_formatted('U',':');
41 }
42
43 =item mac_addr_formatted CASE DELIMITER
44
45 Format the MAC address (for use by exports).  If CASE starts with "l"
46 (for "lowercase"), it's returned in lowercase.  DELIMITER is inserted
47 between octets.
48
49 =cut
50
51 sub mac_addr_formatted {
52   my $self = shift;
53   my ($case, $delim) = @_;
54   my $addr = $self->mac_addr;
55   $addr = lc($addr) if $case =~ /^l/i;
56   join( $delim || '', $addr =~ /../g );
57 }
58
59 =back
60
61 =head1 BUGS
62
63 =cut
64
65 1;