<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>murajun1978</author_name>
  <author_url>https://blog.hatena.ne.jp/murajun1978/</author_url>
  <blog_title>Murajun's Style</blog_title>
  <blog_url>https://murajun1978.hatenadiary.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Arrayの要素を計算したいケースが多々あります。 代表的なものがこれ [1, 2, 3].inject(:+) # =&gt; 6 引数を渡したい！ [1, 2, 3].each_with_object(1).map(&amp;:+) # =&gt; [2, 3, 4] 二次元配列で要素ごとの集計 0番目、1番目、3番目の要素を集計しています。 [[1, 2, 3], [4, 5, 6]].transpose.map{|n| n.inject(:+)} # =&gt; [5, 7, 9] Array#transposeは行と列の入れ替えをします。 [[1, 2, 3], [4, 5, 6]].transpose # …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmurajun1978.hatenadiary.com%2Fentry%2F2014%2F09%2F13%2F020210&quot; title=&quot;RubyのArray要素の計算ヘ(^o^)ノ - Murajun&amp;#39;s Style&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>2014-09-13 02:02:10</published>
  <title>RubyのArray要素の計算ヘ(^o^)ノ</title>
  <type>rich</type>
  <url>https://murajun1978.hatenadiary.com/entry/2014/09/13/020210</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
