module BotFramework::Util

Public Class Methods

camel_case_lower(string) click to toggle source
# File lib/bot_framework/util.rb, line 13
def camel_case_lower(string)
  string = string.to_s unless string.is_a? String
  string.split('_').inject([]) { |buffer, e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
end
to_underscore(string) click to toggle source
# File lib/bot_framework/util.rb, line 4
def to_underscore(string)
  string = string.to_s unless string.is_a? String
  string.gsub(/::/, '/')
        .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
        .gsub(/([a-z\d])([A-Z])/, '\1_\2')
        .tr('-', '_')
        .downcase
end