<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>omdwn</author_name>
  <author_url>https://blog.hatena.ne.jp/omdwn/</author_url>
  <blog_title>インドカレーファンクラブ</blog_title>
  <blog_url>https://omdwn.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>僕はC#を書く人間なので当然返り値のあるメソッドではreturnは必ず書くし、そうしないとVisualStudioさんに怒られるそのやりとりも愛おしく思っている が、Rubyのメソッドではreturnは必ずしも必要ではない こんな感じにhogeメソッドの中で最後にresを書いておくだけで暗黙的にそれが返り値になる def hoge res = '' 2.times{ res &lt;&lt; 'hey!'} res end f = hoge p f # &quot;hey!hey!&quot; 怖～～と思うんだけどコレは慣れとのことなので、はやく慣れたい ※ついでにresを最後に書かないと2.times...の実行結果、つま…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fomdwn.hatenablog.com%2Fentry%2F2020%2F05%2F20%2F020033&quot; title=&quot;【Ruby】メソッドにおけるreturnの使いどころ - インドカレーファンクラブ&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>2020-05-20 02:00:33</published>
  <title>【Ruby】メソッドにおけるreturnの使いどころ</title>
  <type>rich</type>
  <url>https://omdwn.hatenablog.com/entry/2020/05/20/020033</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
