Skip to content

Instantly share code, notes, and snippets.

@yucao24hours
Last active December 27, 2015 00:32
Show Gist options
  • Select an option

  • Save yucao24hours/8e0400695829b09d304b to your computer and use it in GitHub Desktop.

Select an option

Save yucao24hours/8e0400695829b09d304b to your computer and use it in GitHub Desktop.
機能 メソッド
単数形の名詞を複数形を変換する String#pluralize
複数形の名詞を単数形に変換する String#singularize
単語間を英大文字で区切った文字列をアンダースコア区切りに変換する(クラス名->ファイル名) String#underscore
アンダースコア区切りの文字列を英大文字区切り文字列に変換する(ファイル名->クラス名) String#camelcase
大文字区切り文字列を複数形のアンダースコア区切り文字列に変換する(クラス名->テーブル名) String#tableize
複数形のアンダースコア区切り文字列を大文字区切り文字列に変換する(テーブル名->クラス名) String#classify
クラス名からクラスそのものを得る String#constantize
機能 メソッド
翌日を求める Date#tomorrow
前日を求める Date#yesterday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment