<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mickey24</author_name>
  <author_url>https://blog.hatena.ne.jp/mickey24/</author_url>
  <blog_title>ぬいぐるみライフ？</blog_title>
  <blog_url>https://mickey24.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Arrayの以下のメソッドについてまとめてみた． select (select!) reject (reject!) partition select : 条件を満たす要素を列挙 条件を満たす要素を列挙するにはselectを使う．selectはブロックの評価結果がtrueとなる要素からなる配列を返す．非破壊的． a = [1, 3, 4, 7, 9, 13] a.select{|e| e % 3 == 0} #=&gt; [3, 9] 破壊的メソッドあり．ただしRuby 1.9.2以降が必要． a.select!{|e| e % 3 == 0} reject : 条件を満たす要素を削除 条件を満たす…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmickey24.hatenablog.com%2Fentry%2F20110227%2Fruby_array_select_reject_partition&quot; title=&quot;Rubyで配列の条件を満たす要素を列挙するor取り除く(select, reject, partition) - ぬいぐるみライフ？&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>2011-02-27 00:00:00</published>
  <title>Rubyで配列の条件を満たす要素を列挙するor取り除く(select, reject, partition)</title>
  <type>rich</type>
  <url>https://mickey24.hatenablog.com/entry/20110227/ruby_array_select_reject_partition</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
