{"author_url":"https://blog.hatena.ne.jp/mas-higa/","title":"\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u306a Array \u306e\u30e1\u30bd\u30c3\u30c9","version":"1.0","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","categories":["Ruby"],"description":"\u3044\u3064\u3082\u300c\u4f55\u304b\u305d\u3046\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3042\u3063\u305f\u306f\u305a\u300d\u3068\u601d\u3063\u3066\u308b\u308a\u307e\u3092\u8abf\u3079\u306a\u304a\u3059\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u30e1\u30e2\u3002 Enumerable#each_cons \u9806\u756a\u306b n \u500b\u305a\u3064\u53d6\u308a\u51fa\u3059\u3002 marunouchi = ['\u65b9\u5357\u753a', '\u4e2d\u91ce\u5bcc\u58eb\u898b\u53f0', '\u4e2d\u91ce\u65b0\u6a4b', '\u4e2d\u91ce\u5742\u4e0a'] marunouchi.each_cons(2).to_a # >> [[\"\u65b9\u5357\u753a\", \"\u4e2d\u91ce\u5bcc\u58eb\u898b\u53f0\"], # >> [\"\u4e2d\u91ce\u5bcc\u58eb\u898b\u53f0\", \"\u4e2d\u91ce\u65b0\u6a4b\"], # >> [\"\u4e2d\u91ce\u65b0\u6a4b\", \"\u4e2d\u91ce\u5742\u4e0a\"]] Array \u306b\u7d4c\u8def\u304c\u5165\u3063\u3066\u3044\u3066 from-to \u3092\u9806\u756a\u306b\u53d6\u308a\u51fa\u3059\u5834\u5408\u306a\u3069\u306b\u4fbf\u5229\u3002 Enumerable#each_slice n \u500b\u305a\u3064\u306b\u5206\u5272\u2026","height":"190","image_url":null,"type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmas-higa.hatenadiary.org%2Fentry%2F20100410%2F1270903865\" title=\"\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u306a Array \u306e\u30e1\u30bd\u30c3\u30c9 - \u3072\u304c\u304d\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://mas-higa.hatenadiary.org/entry/20100410/1270903865","blog_url":"https://mas-higa.hatenadiary.org/","published":"2010-04-10 21:51:05","author_name":"mas-higa","blog_title":"\u3072\u304c\u304d\u306e\u65e5\u8a18","width":"100%"}