This module contains utility class/modules/methods that can be used by both parsers and converters.
Treat name as if it were snake cased (e.g. snake_case) and camelize it (e.g. SnakeCase).
# File lib/kramdown/utils.rb, line 24 def self.camelize(name) name.split('_').inject('') {|s,x| s << x[0..0].upcase << x[1..-1] } end
Treat name as if it were camelized (e.g. CamelizedName) and snake-case it (e.g. camelized_name).
# File lib/kramdown/utils.rb, line 29 def self.snake_case(name) name = name.dup name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') name.gsub!(/([a-z])([A-Z])/,'\1_\2') name.downcase! name end
Generated with the Darkfish Rdoc Generator 2.