æ°å¹´ããã§ã¨ããããã¾ãã2009å¹´ã®æåã®ãã¿ã¯ããã°ã©ãã³ã°ã®ãã¿ã«ãããã¨ã«ãã¾ããã Rubyã«ã¤ãã¦ã®ã¹ãããªã¨ã³ããªã¼ããã£ãã®ã§ãç´¹ä»ãã¾ãã no title ç§ã¯ç¿»è¨³è½åããªãã°ãããããªã¼ãã£ã³ã°è½åã貧ç¸ã§ãããã²ãåæãèªãã§ã¿ã¦ãã ããã ã¯ããã« Rubyã®blockãProcãlambdaã¯ãã¯ãã«ã§ããã解ãã«ãããRubyã¯ã¯ãã¼ã¸ã£ã使ãæ¹æ³ã4ã¤ãã£ã¦ããããããã§ãããã¤éãã¾ããããã§ã¯ããã®ã¸ãã解説ãããã¨æãã¾ãã Block ãã£ã¨ãç°¡åã§ããã¤Rubyã£ã½ãã¨è¨ãã°ãBlockã§ããã array = [1, 2, 3, 4] array.collect! do |n| n ** 2 end puts array.inspect # => [1, 4, 9, 16] ä½ãèµ·ãã£ã¦ãããï¼ ã¾ããblockä»ãã§Arrayã®"collect
{{#tags}}- {{label}}
{{/tags}}