{"title":"Ruby\u306eblock\u3084Proc\u3092\u5206\u304b\u3063\u305f\u3064\u3082\u308a\u306b\u306a\u3063\u3066\u3044\u3066\u898b\u4e8b\u306b\u30cf\u30de\u3063\u305f","author_name":"tango_ruby","provider_name":"Hatena Blog","url":"https://tango-ruby.hatenablog.com/entry/2017/04/23/021630","categories":["Ruby","Rails","\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0"],"provider_url":"https://hatena.blog","width":"100%","image_url":null,"version":"1.0","height":"190","published":"2017-04-23 02:16:30","author_url":"https://blog.hatena.ne.jp/tango_ruby/","blog_url":"https://tango-ruby.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftango-ruby.hatenablog.com%2Fentry%2F2017%2F04%2F23%2F021630\" title=\"Ruby\u306eblock\u3084Proc\u3092\u5206\u304b\u3063\u305f\u3064\u3082\u308a\u306b\u306a\u3063\u3066\u3044\u3066\u898b\u4e8b\u306b\u30cf\u30de\u3063\u305f - \u30d9\u30eb\u30ea\u30f3\u306eIT\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3067\u50cd\u304f\u30b8\u30e3\u30d0\u30fb\u30b6\u30fb\u30cf\u30c3\u30c8\u30ea\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"\u30d9\u30eb\u30ea\u30f3\u306eIT\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3067\u50cd\u304f\u30b8\u30e3\u30d0\u30fb\u30b6\u30fb\u30cf\u30c3\u30c8\u30ea\u306e\u65e5\u8a18","type":"rich","description":"\u53cd\u7701\u3057\u305f\u3002Ruby\u306eblock\u3084Proc\u3092\u5206\u304b\u3063\u305f\u3064\u3082\u308a\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u3057\u3087\u3046\u3082\u306a\u3044\u3068\u3053\u308d\u3067\u30cf\u30de\u3063\u305f\u3002\u81ea\u6212\u3092\u8fbc\u3081\u3066\u30d6\u30ed\u30b0\u306b\u6b8b\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3057\u305f\u3002 $ ruby -v ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15] \u4f8b\uff11 def method_1 if block_given? puts 'Yes' yield else puts 'No' end end method_1 { puts 'I am a block' } \u3064\u307e\u308amethod_1\u306bI am a block\u306e\u51fa\u529b\u3068\u3044\u3046\u30d6\u30ed\u30c3\u30af\u3092\u6e21\u3057\u3066\u3001\u30d6\u30ed\u30c3\u30af\u304c\u6709\u308c\u3070Yes\u3068\u5171\u2026"}