Sha256: b2c299a39d766191897fcce135b0f8e1d1bca9ba682b7cfa1e677474ff1b977c

Contents?: true

Size: 645 Bytes

Versions: 2

Compression:

Stored size: 645 Bytes

Contents

# # shortcut to call a class method that you would like to be traceable
# def ccm(className, sym, *args, &block)
#   TraceableObject.call_class_method(className, sym, *args, &block)
# end
# # shortcut to instantiate a traceable object
# def cto(className)
#   TraceableFactory.createTraceableObject(className)
# end

def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
  if first_letter_in_uppercase
    lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
  else
    lower_case_and_underscored_word.first + camelize(lower_case_and_underscored_word)[1..-1]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rcli-0.1.2 lib/core/global_functions.rb
rcli-0.1.0 lib/core/global_functions.rb