以下の内容はhttps://tbpgr.hatenablog.com/entry/20140219/1392813186より取得しました。


ActiveSupport | String#camelize

概要

String#camelize

詳細

String#camelize について

String#camelize

文字列をキャメルケースにした結果を受け取る
引数に「:lower」を与えると、最初の文字が小文字になる

サンプル

# encoding: utf-8
require 'active_support/core_ext/string/inflections'
require 'tbpgr_utils'

bulk_puts_eval binding, <<-EOS
'snake_case'.camelize
'snake_case'.camelize(:lower)
'lower'.camelize
'UPPER'.camelize
'some_module/some_class'.camelize
EOS

__END__
・下記はTbpgrUtils gemの機能
bulk_puts_eval

https://rubygems.org/gems/tbpgr_utils
https://github.com/tbpgr/tbpgr_utils

出力

'snake_case'.camelize # => "SnakeCase"
'snake_case'.camelize(:lower) # => "snakeCase"
'lower'.camelize # => "Lower"
'UPPER'.camelize # => "UPPER"
'some_module/some_class'.camelize # => "SomeModule::SomeClass"



以上の内容はhttps://tbpgr.hatenablog.com/entry/20140219/1392813186より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14