{"author_name":"mas-higa","version":"1.0","categories":["Ruby"],"provider_name":"Hatena Blog","published":"2009-08-17 23:07:43","blog_url":"https://mas-higa.hatenadiary.org/","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmas-higa.hatenadiary.org%2Fentry%2F20090817%2F1250518063\" title=\"\u591a\u91cd\u4ee3\u5165\u3068\u6697\u9ed9\u306e\u578b\u5909\u63db - \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>","author_url":"https://blog.hatena.ne.jp/mas-higa/","description":"\u4ee5\u524d Ruby \u306b\u306f\u578b\u5909\u63db\u30e1\u30bd\u30c3\u30c9\u304c\u6ca2\u5c71\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u3042\u307e\u308a\u6697\u9ed9\u306e\u578b\u5909\u63db\u306f\u3057\u3066\u304f\u308c\u306a\u3044\u3068\u66f8\u3044\u305f\u3002 \u6697\u9ed9\u306e\u578b\u5909\u63db \u3068\u3053\u308d\u304c\u591a\u91cd\u4ee3\u5165\u3092\u3059\u308b\u3068 Array \u3078\u306e\u578b\u5909\u63db\u3092\u3084\u3063\u3066\u304f\u308c\u308b\u3089\u3057\u3044\u3002 class Foo def to_a; [:to_a] end def to_ary; [:to, :ary] end end foo = Foo.new # \u5de6\u8fba\u304c\u8907\u6570\u3067\u53f3\u8fba\u304c\u3072\u3068\u3064\u306a\u3089 to_ary \u304c\u547c\u3070\u308c\u308b x, y = foo # => #<Foo:0x100b3780> x # => :to y # => :ary # \u660e\u793a\u7684\u306b * \u3067\u5c55\u958b\u3059\u308b\u3068 to_a \u304c\u547c\u3070\u308c\u308b x, y = *foo # \u2026","width":"100%","url":"https://mas-higa.hatenadiary.org/entry/20090817/1250518063","height":"190","blog_title":"\u3072\u304c\u304d\u306e\u65e5\u8a18","type":"rich","title":"\u591a\u91cd\u4ee3\u5165\u3068\u6697\u9ed9\u306e\u578b\u5909\u63db","image_url":null}