<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hiroppon</author_name>
  <author_url>https://blog.hatena.ne.jp/hiroppon/</author_url>
  <blog_title>中年engineerの独り言 - crumbjp</blog_title>
  <blog_url>https://crumbjp.hateblo.jp/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>Block Rubyにはブロックという要素があるが、File.open の様に、 値を返却したり、ブロックで扱ったりを両方出来る関数 がふと気になった。 f = File.open(&quot;file&quot;) f.each {|l| ... } File.open(&quot;file&quot;){ |f| f.each {|l| ... } } block_given? こんな関数で切り分けが出来るらしい。 何ともrubyっぽい！ class Block def initialize(num) @a = Array.new (0..num).each { |i| @a[i] = i*10 } end def test (…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcrumbjp.hateblo.jp%2Fentry%2F20130411%2F1365644735&quot; title=&quot;Rubyのブロックを勉強した - 中年engineerの独り言 - crumbjp&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>2013-04-11 10:45:35</published>
  <title>Rubyのブロックを勉強した</title>
  <type>rich</type>
  <url>https://crumbjp.hateblo.jp/entry/20130411/1365644735</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
