lib/ruby-lokalise-api/utils/string_utils.rb
def snakecase
          base_class_name.
            gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
            gsub(/([a-z\d])([A-Z])/, '\1_\2').
            tr('-', '_').
            gsub(/\s/, '_').
            gsub(/__+/, '_').
            downcase
        end
# Underscore a string such that camelcase, dashes and spaces are
# replaced by underscores.
Underscore a string such that camelcase, dashes and spaces are
replaced by underscores.
Underscore a string such that camelcase dashes and spaces are replaced by underscores .
def snakecase
          base_class_name.
            gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
            gsub(/([a-z\d])([A-Z])/, '\1_\2').
            tr('-', '_').
            gsub(/\s/, '_').
            gsub(/__+/, '_').
            downcase
        end
def snakecase base_class_name . gsub ( / ([A-Z]+)([A-Z][a-z]) / , '\1_\2' ) . gsub ( / ([a-z \d ])([A-Z]) / , '\1_\2' ) . tr ( '-' , '_' ) . gsub ( / \s / , '_' ) . gsub ( / __+ / , '_' ) . downcase end
Underscore a string such that camelcase, dashes and spaces are
replaced by underscores.
Underscore a string such that camelcase dashes and spaces are replaced by underscores .