lib/ib_ruby_proxy/util/string_utils.rb
# Makes passed string underscored and lowercase
#
# @param [String] string
#
# Implementation copied from Rails
# @see https://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-underscore
Makes passed string underscored and lowercase
Makes passed string underscored and lowercase
def to_underscore(string)
        string.gsub(/::/, '/')
              .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
              .gsub(/([a-z\d])([A-Z])/, '\1_\2')
              .tr('-', '_')
              .downcase
      end
def to_underscore ( string ) string . gsub ( / :: / , '/' ) . gsub ( / ([A-Z]+)([A-Z][a-z]) / , '\1_\2' ) . gsub ( / ([a-z \d ])([A-Z]) / , '\1_\2' ) . tr ( '-' , '_' ) . downcase end
Makes passed string underscored and lowercase
Makes passed string underscored and lowercase
string
<not_specific>
<not_specific>
string Implementation copied from Rails
string Implementation copied from Rails
see
None