class Pettanr class Pettanr.AppHelper @icon_tag: (name, opt = {}) -> title = if opt['object'] name + ' ID:' + opt['object'].get(id).toString() else name size = if opt['size'] parseInt(opt['size']) else 35 "\""" class Pettanr.AppController #>> https://gist.github.com/davidjbeveridge/3813724 @xeach: (arr, func, index=0) -> if index < arr.length then [ func(arr[index], index), @xeach(arr, func, index + 1)... ] else [] @camelize: (input) -> pieces = input.split(/[\W_-]/) @xeach(pieces, @capitalize).join("") @capitalize: (input) -> input.charAt(0).toUpperCase() + input.slice(1) @lowercase: (input) -> input.toLowerCase() @underscore: (input) -> pieces = input.replace(/([A-Z])/g, '_$1').split(/[\W_-]/).filter (n) -> !!n @xeach(pieces, @lowercase ).join("_") # << @is_a_string: (str) -> if (str instanceof String) or (typeof str == "string") true else false @Pettanr = Pettanr