<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>keichanzahorumon0405</author_name>
  <author_url>https://blog.hatena.ne.jp/keichanzahorumon0405/</author_url>
  <blog_title>技術開発日記</blog_title>
  <blog_url>https://kechanzahorumon.hatenadiary.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Rubyを勉強していて一番につまずいたのはこのブロックというやつ。 javaをずっとやっていたせいか、どうもこのブロックという概念が掴みにくい。そこで少し調べて見て、以下の内容にまとめてみた。 とりあえずブロックとは？ ブロックは二言で言えば「コードの塊」そして「オブジェクトじゃない」 メソッドから渡されたブロックの利用方法 ・明示的にメソッドにブロック引数の宣言をする。 def func (&amp;block) block.call end # funcを実行 func do p &quot;sample&quot; end ・引数の宣言をしないで、yieldのみを宣言 def func yield end # fu…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkechanzahorumon.hatenadiary.com%2Fentry%2F2012%2F10%2F16%2F110408&quot; title=&quot;ブロックの使い方 - 技術開発日記&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>2012-10-16 11:04:08</published>
  <title>ブロックの使い方</title>
  <type>rich</type>
  <url>https://kechanzahorumon.hatenadiary.com/entry/2012/10/16/110408</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
