ãããåæ©çã§ãããæ°å¹´ä¸çºç®ã®ã¨ã³ããªã¯å»å¹´ã®ç©ã¿æ®ãããã each [1] pry(main)> def each_sample [1] pry(main)* (1..10).to_a.each do |i| [1] pry(main)* piyo = i + 1 [1] pry(main)* end [1] pry(main)* end => :hoge [2] pry(main)> hoge = each_sample() => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] http://ref.xaio.jp/ruby/classes/array/each eachã¡ã½ããã¯ãé åã®è¦ç´ ã®æ°ã ããããã¯ãç¹°ãè¿ãå®è¡ãã¾ããç¹°ãè¿ããã¨ã«ãããã¯å¼æ°ã«ã¯åè¦ç´ ãé ã«å ¥ãã¾ããæ»ãå¤ã¯ã¬ã·ã¼ãèªèº«ã§ãã ã¬ã·ã¼ãèªèº« ãè¿ãã®ã§ããããä¸ã§ piyo ã«ä»£å ¥ãã
{{#tags}}- {{label}}
{{/tags}}