<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>simanman</author_name>
  <author_url>https://blog.hatena.ne.jp/simanman/</author_url>
  <blog_title>simanのブログ</blog_title>
  <blog_url>https://simanman.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Rubyでコードゴルフをやるときに覚えておくと便利です。 joinは*に置き換える joinメソッドは配列を連結させるときに使用するのですが、これは「*」で置き換えることができます。 puts [1,2,3].join('+') puts [1,2,3]*'+' 1+2+3 1+2+3これだけで6文字も短く出来ました。 組み込み変数を使用する コードゴルフでは「変数の宣言すら長く感じる」ので、用意されている変数を使用することでコードが短くなる場合があります。例えば「$*」はRuby実行時における引数を配列に格納したものですが、これをすでに宣言された配列として扱うことが可能です。 $*の使用例 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsimanman.hatenablog.com%2Fentry%2F2013%2F06%2F18%2F010121&quot; title=&quot;Code golf tips of Ruby(4) - simanのブログ&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-06-18 01:01:21</published>
  <title>Code golf tips of Ruby(4)</title>
  <type>rich</type>
  <url>https://simanman.hatenablog.com/entry/2013/06/18/010121</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
