[freeside-commits] branch FREESIDE_3_BRANCH updated. ade732335aaad65e5b3b31174e9e3a739d90bbb7

Ivan ivan at 420.am
Sun Nov 17 21:50:11 PST 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  ade732335aaad65e5b3b31174e9e3a739d90bbb7 (commit)
      from  26210bd8dc75076209944cb45b891b4a51bf8a9e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ade732335aaad65e5b3b31174e9e3a739d90bbb7
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Nov 17 21:50:10 2013 -0800

    svc_cable label, RT#26013

diff --git a/FS/FS/svc_MAC_Mixin.pm b/FS/FS/svc_MAC_Mixin.pm
new file mode 100644
index 0000000..737a8e8
--- /dev/null
+++ b/FS/FS/svc_MAC_Mixin.pm
@@ -0,0 +1,65 @@
+package FS::svc_MAC_Mixin;
+
+use strict;
+#use FS::Record qw(qsearch);
+#use FS::Conf;
+# careful about importing anything here--it will end up in a LOT of 
+# namespaces
+
+#use vars qw(@subclasses $DEBUG $conf);
+
+#$DEBUG = 0;
+
+# any subclass that can have MAC addresses needs to be added here
+#@subclasses = (qw(FS::svc_broadband FS::svc_cable));
+
+#sub conf {
+#  $conf ||= FS::Conf->new;
+#}
+
+=head1 NAME
+
+FS::MAC_Mixin - Mixin class for objects that have MAC addresses assigned.
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=head1 METHODS
+
+=over 4
+
+=item mac_addr_pretty
+
+=cut
+
+sub mac_addr_pretty {
+  my $self = shift;
+  $self->mac_addr_formatted('U',':');
+}
+
+=item mac_addr_formatted CASE DELIMITER
+
+Format the MAC address (for use by exports).  If CASE starts with "l"
+(for "lowercase"), it's returned in lowercase.  DELIMITER is inserted
+between octets.
+
+=cut
+
+sub mac_addr_formatted {
+  my $self = shift;
+  my ($case, $delim) = @_;
+  my $addr = $self->mac_addr;
+  $addr = lc($addr) if $case =~ /^l/i;
+  join( $delim || '', $addr =~ /../g );
+}
+
+=back
+
+=head1 BUGS
+
+=cut
+
+1; 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/svc_MAC_Mixin.pm |   65 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 FS/FS/svc_MAC_Mixin.pm




More information about the freeside-commits mailing list