08 Apr '16, 10pm

20分ではじめるRuby: いちいち入力せずに、何度も“Hello”と言いたい時にはどうすればいいでしょうか? メソッドを定義しましょう! irb(main):010:0> def hi… https://t.co/bal0eu0QmG [ruby]

irb(main):024:0> class Greeter irb(main):025:1> def initialize(name = "World") irb(main):026:2> @name = name irb(main):027:2> end irb(main):028:1> def say_hi irb(main):029:2> puts "Hi [email protected]}!" irb(main):030:2> end irb(main):031:1> def say_bye irb(main):032:2> puts "Bye [email protected]}, come back soon." irb(main):033:2> end irb(main):034:1> end => :say_bye

Full article: https://www.ruby-lang.org/ja/documentation/quickstart/2/

Tweets

20分ではじめるRuby https://t.co/azNpjdsZcf

ruby-lang.org 05 Apr '16, 2pm

# @names is a list of some kind, iterate!

20分ではじめるRuby https://t.co/ck650vxR3R

ruby-lang.org 04 Apr '16, 11am

irb(main):002:0> puts "Hello World" Hello World => nil