class String

Public Instance Methods

protect_from_numbers() click to toggle source
# File lib/rescodegen/key_generator/code_safe_key_generator.rb, line 41
def protect_from_numbers
    sub(/(^[0-9])/, "_\\1")
end
remove_duplicate_underscores() click to toggle source
# File lib/rescodegen/key_generator/code_safe_key_generator.rb, line 33
def remove_duplicate_underscores
    gsub(/_+/, "_")
end
replace_string_format_specifiers() click to toggle source
# File lib/rescodegen/key_generator/code_safe_key_generator.rb, line 21
def replace_string_format_specifiers
    gsub(/%\.[0-9]f|%[a-zA-Z@]+/, "_")
end
replace_unsupported_characters() click to toggle source
# File lib/rescodegen/key_generator/code_safe_key_generator.rb, line 25
def replace_unsupported_characters
    gsub(/[^a-zA-Z0-9]/, "_")
end
replace_whitespace() click to toggle source
# File lib/rescodegen/key_generator/code_safe_key_generator.rb, line 29
def replace_whitespace
    gsub(/\s+/, "_")
end
trim_underscores() click to toggle source
# File lib/rescodegen/key_generator/code_safe_key_generator.rb, line 37
def trim_underscores
    gsub(/^_|_$/, "")
end