<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mtoyoshi</author_name>
  <author_url>https://blog.hatena.ne.jp/mtoyoshi/</author_url>
  <blog_title>mtoyoshi開発メモ</blog_title>
  <blog_url>https://mtoyoshi.hateblo.jp/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>よくある記述としてこんなのがある。以下はJavaで書いた。 if (ary.length == 0) { return; } rubyだとこんな風にかける。 return if ary.length.zero? 追記 rubikitchさんにコメントいただきました！ return if ary.empty? 確かにこう書くと更にシンプルになりますね♪ Javaでも配列ではなく、Listを使えば同じようなメソッドがあります。 if (list.isEmpty()) { return; }</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmtoyoshi.hateblo.jp%2Fentry%2F20081207%2F1228635405&quot; title=&quot;配列の長さゼロの表現 - mtoyoshi開発メモ&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>2008-12-07 16:36:45</published>
  <title>配列の長さゼロの表現</title>
  <type>rich</type>
  <url>https://mtoyoshi.hateblo.jp/entry/20081207/1228635405</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
