2016-08-09から1日間の記事一覧
Ruby on Railsチュートリアル(第3版) 今日は「4.2.4 メソッドの定義」から。 4.2.4 メソッドの定義 コンソールでstring_messageというメソッドを定義。 >> def string_message(str = '') >> if str.empty? >> "It's an empty string!" >> else ?> "The strin…
Ruby on Railsチュートリアル(第3版) 今日は「4.2.4 メソッドの定義」から。 4.2.4 メソッドの定義 コンソールでstring_messageというメソッドを定義。 >> def string_message(str = '') >> if str.empty? >> "It's an empty string!" >> else ?> "The strin…