module RPath::Util

@private

Public Class Methods

camelcase(string) click to toggle source
# File lib/rpath/util.rb, line 10
def camelcase(string)
  string.gsub(/(?:^|_)([a-z])/) { $1.upcase }
end
first_defined_const(module_, *consts) click to toggle source
# File lib/rpath/util.rb, line 14
def first_defined_const(module_, *consts)
  const = consts.find { |c| module_.const_defined?(c) }
  const && module_.const_get(const)
end
underscore(string) click to toggle source
# File lib/rpath/util.rb, line 6
def underscore(string)
  string.gsub(/([^A-Z])([A-Z])/, '\1_\2').downcase
end