<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shimabukuro558</author_name>
  <author_url>https://blog.hatena.ne.jp/shimabukuro558/</author_url>
  <blog_title>shimabukuro558の日記</blog_title>
  <blog_url>https://shimabukuro558.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>文法</anon>
    <anon>言語仕様</anon>
  </categories>
  <description>ブロック付きメソッドとは…メソッドの引数にブロック(do…endもしくは{}で囲まれた処理)を渡すことができる。 ■事前準備 # ブロック付きメソッドの呼び出し準備 # 引数f:ブロック def delegate(f) # ブロックに処理を委譲 yield f end■方法１ delegate(200) {|i| p i * 7}【実行結果】 # delegateメソッドに引数1:200、引数2:ブロックを渡していると解釈 irb(main):030:0&gt; delegate(200) {|i| p i * 7} 1400 =&gt; nil■方法２ delegate(300, {|i| p i * …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshimabukuro558.hatenadiary.org%2Fentry%2F20100423%2F1271989843&quot; title=&quot;Rubyのブロック付きメソッドの解説 - shimabukuro558の日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-04-23 11:30:43</published>
  <title>Rubyのブロック付きメソッドの解説</title>
  <type>rich</type>
  <url>https://shimabukuro558.hatenadiary.org/entry/20100423/1271989843</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
