Sha256: cb4ef921396899967a3167bc41d3cdb6c8a90ffd7954a8edbaed89ddd1ceae71
Contents?: true
Size: 1.05 KB
Versions: 8
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
8 entries across 8 versions & 1 rubygems