<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>osyo-manga</author_name>
  <author_url>https://blog.hatena.ne.jp/osyo-manga/</author_url>
  <blog_title>Secret Garden(Instrumental)</blog_title>
  <blog_url>https://secret-garden.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Ruby 2.5 では Object#yield_self というメソッドが追加される予定です。 これは以下のような実装になっています。 class Object def yield_self yield(self) end end 平たく言うと『ブロックの戻り値を返す #tap』って感じですね。 何が嬉しいのか この手の『なんか便利そうなメソッド』のユースケースを説明するのが難しいんですが、とりあえず『#tap + break』で任意の戻り値を返したいような場合は #yield_self が利用できるかと。 # break を使って任意の戻り値を返す # [1, 2, 3].tap { |m…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2017%2F10%2F20%2F234157&quot; title=&quot;Ruby 2.5 で追加される yield_self メソッド - Secret Garden(Instrumental)&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>2017-10-20 23:41:57</published>
  <title>Ruby 2.5 で追加される yield_self メソッド</title>
  <type>rich</type>
  <url>https://secret-garden.hatenablog.com/entry/2017/10/20/234157</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
