Class: Rescodegen::ObjcCodeFormatter

Inherits:
CodeFormatter show all
Defined in:
lib/rescodegen/code_formatter/objc_code_formatter.rb

Instance Method Summary collapse

Instance Method Details

#format_string(string) ⇒ Object



6
7
8
9
# File 'lib/rescodegen/code_formatter/objc_code_formatter.rb', line 6

def format_string(string)
    string.sub(/^[a-z]/, &:upcase)
    .gsub(/_[A-Z]+/) { |s| downcase_string_unless_acronym(s) }
end