Module: Relaton::Render::Template::CapitalizeFirst

Defined in:
lib/relaton/render/template/liquid.rb

Instance Method Summary collapse

Instance Method Details

#capitalize_first(words) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/relaton/render/template/liquid.rb', line 5

def capitalize_first(words)
  return nil if words.nil?

  ret = words.split(/[ _]/)
  ret.first.capitalize! if ret.size.positive?
  ret.join("_")
end