<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>s-shin</author_name>
  <author_url>https://blog.hatena.ne.jp/s-shin/</author_url>
  <blog_title>$ cat /var/log/shin</blog_title>
  <blog_url>https://shin.hateblo.jp/</blog_url>
  <categories>
    <anon>Programming</anon>
    <anon>Ruby</anon>
  </categories>
  <description>かなりハマったのでメモです。 範囲演算子 Rubyには..と...の2種類の範囲演算子があります。実態はRangeクラスで、Range#eachメソッドでfor文のように使うイディオムがあります。 irb(main):005:0&gt; (0..2).each { |i| p i } 0 1 2 =&gt; 0..2 irb(main):006:0&gt; (0...2).each { |i| p i } 0 1 =&gt; 0...2余談ですが、0から開始ならInteger#timesも使えます。 irb(main):007:0&gt; 3.times { |i| p i } 0 1 2 =&gt; 3 降順のRange 先日…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshin.hateblo.jp%2Fentry%2F2012%2F12%2F20%2F202641&quot; title=&quot;Rubyの範囲演算子は降順のイテレートには使えない - $ cat /var/log/shin&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>2012-12-20 20:26:41</published>
  <title>Rubyの範囲演算子は降順のイテレートには使えない</title>
  <type>rich</type>
  <url>https://shin.hateblo.jp/entry/2012/12/20/202641</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
