Sha256: c5b6f08e5a55c1bfa289adf8d75448f69360d8aa0bc65bf3ad573969601aeee4
Contents?: true
Size: 1.05 KB
Versions: 16
Compression:
Stored size: 1.05 KB
Contents
(function (undefined) { angular.module('rails').factory('RailsInflector', function() { function camelize(key) { if (!angular.isString(key)) { return key; } // should this match more than word and digit characters? return key.replace(/_[\w\d]/g, function (match, index, string) { return index === 0 ? match : string.charAt(index + 1).toUpperCase(); }); } function underscore(key) { if (!angular.isString(key)) { return key; } // TODO match the latest logic from Active Support return key.replace(/[A-Z]/g, function (match, index) { return index === 0 ? match : '_' + match.toLowerCase(); }); } function pluralize(value) { // TODO match Active Support return value + 's'; } return { camelize: camelize, underscore: underscore, pluralize: pluralize }; }); }());
Version data entries
16 entries across 16 versions & 1 rubygems