{"blog_url":"https://saitodevel01.hatenadiary.org/","image_url":null,"url":"https://saitodevel01.hatenadiary.org/entry/20100605/1275728303","width":"100%","published":"2010-06-05 17:58:23","description":"Ruby\u3067\u306f\uff0cStruct\u30af\u30e9\u30b9\u3092\u7528\u3044\u308b\u3053\u3068\u306b\u3088\u3063\u3066\uff0c\u7279\u5b9a\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3064\u30af\u30e9\u30b9\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 Foo = Struct.new(\"Foo\", \"foo\", \"bar\") f = Foo.new(1, 2) p f.foo # 1 p f.bar # 2 \u4e00\u65b9\u3001Python\u306e\u5834\u5408\u3001namedtuple\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u540c\u69d8\u306e\u6a5f\u80fd\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 namedtuple\u306fPython2.6\u4ee5\u964d\u3067\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002 from collections import namedtuple Foo = namedtuple(\"Foo\", \"foo bar\") f = Foo(1, 2)\u2026","author_url":"https://blog.hatena.ne.jp/saitodevel01/","title":"Python\u3067Ruby\u306eStruct\u98a8\u306e\u69cb\u9020\u4f53\u3092\u5b9f\u73fe\u3059\u308b","blog_title":"saito\u2019s blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsaitodevel01.hatenadiary.org%2Fentry%2F20100605%2F1275728303\" title=\"Python\u3067Ruby\u306eStruct\u98a8\u306e\u69cb\u9020\u4f53\u3092\u5b9f\u73fe\u3059\u308b - saito\u2019s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["Python","Ruby","\u8a00\u8a9e\u30cd\u30bf"],"height":"190","version":"1.0","author_name":"saitodevel01","provider_name":"Hatena Blog","type":"rich","provider_url":"https://hatena.blog"}