String#pluralize
単数形から複数形に変換
irb(main):014:0> ['phone', 'wolf', 'fish', 'class'].map(&:pluralize)
=> ["phones", "wolves", "fish", "classes"]
String#singularize
複数形から単数形に変換
irb(main):015:0> ["phones", "wolves", "fish", "classes"].map(&:singularize)
=> ["phone", "wolf", "fish", "class"]
String#underscore
クラス名からファイル名に変換
irb(main):016:0> "ActiveRecord::Base".underscore
=> "active_record/base"
String#camelize
ファイル名からクラス名に変換
irb(main):017:0> "active_record/base".camelize
=> "ActiveRecord::Base"
String#classify
テーブル名からクラス名に変換
irb(main):006:0> ['people', 'wolves'].map(&:classify)
=> ["Person", "Wolf"]
String#tableize
クラス名からテーブル名に変換
irb(main):007:0> ["Person", "Wolf"].map(&:tableize)
=> ["people", "wolves"]