<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mas-higa</author_name>
  <author_url>https://blog.hatena.ne.jp/mas-higa/</author_url>
  <blog_title>ひがきの日記</blog_title>
  <blog_url>https://mas-higa.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>「リファクタリング Ruby エディション」によると、一時変数は極力排除した方がいいらしい。メソッドチェーンを使えば、結果をいちいち変数に覚えなくても最終結果だけ得られる。 s.split(/\n/).each_slice(2).map(&amp;:join) でも、結果が意図したものと違ったら、どこでおかしくなったのか分からない。 じゃあメソッドの結果を変数に覚えて p デバッグする?s = s.split(/\n/) p s # &gt;&gt; [&quot;こんにちは&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;あしたは&quot;, &quot;&quot;, &quot;すずしくなる&quot;, &quot;&quot;, &quot;はず、としんじます&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;では、&quot;, &quot;&quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmas-higa.hatenadiary.org%2Fentry%2F20100805%2F1281018189&quot; title=&quot;メソッドチェーンの p デバッグ? それ tap でできるよ - ひがきの日記&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>https://images-fe.ssl-images-amazon.com/images/I/51nTwl4%2B1DL._SL75_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-08-05 23:23:09</published>
  <title>メソッドチェーンの p デバッグ? それ tap でできるよ</title>
  <type>rich</type>
  <url>https://mas-higa.hatenadiary.org/entry/20100805/1281018189</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
