ãåç¥ã®éã Ruby ã§ã¯ä»®å¼æ°ã®æå¾ã« '&' ãåç½®ããããããã¯å¼æ°ãã宣è¨ãããã¨ã§ãã¡ã½ããã«æ¸¡ããããããã¯ãProcãªãã¸ã§ã¯ãã¨ãã¦åãåããã¨ãã§ãã¾ããã¤ã¾ãã¡ã½ããã«æ¸¡ããããããã¯ãå¼ã¶æ¹æ³ã«ã¯2éãããã¾ãã def m1 yield :m1 end def m2(&block) block.call(:m2) end m1{|a| p a } # => :m1 m2{|a| p a } # => :m2 ãã®2éãã®ãããã¯å¼ã³åºãã®éãã«ã¤ãã¦è§¦ããè¨äºãããããããã¾ãã*1 *2 主ã«ãããã¯ã渡ããã¦ããªãæã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ãéããªã©ã®æåã®éãã«ã¤ãã¦è§¦ãããã¦ãã¾ããããã®æç« ã§ã¯ä¸¡è ã®YARVã§ã®å®è£ ä¸ã®å·®ç°ã¨ããã©ã¼ãã³ã¹ã®éãã«ã¤ãã¦æ¸ãã¾ãã æåã«çµè«ã "å¯è½ãªã Proc#call ã§ã¯ãªã yield ã使ãã" ãå¯è½ãªããã¨ã
{{#tags}}- {{label}}
{{/tags}}