{"published":"2008-05-29 15:10:33","blog_url":"https://rubikitch.hatenadiary.org/","categories":["ruby"],"author_name":"rubikitch","provider_url":"https://hatena.blog","type":"rich","height":"190","url":"https://rubikitch.hatenadiary.org/entry/20080529/1212041433","description":"2008-05-28 require 'erb' Foo = Struct.new(:foo, :bar) foo = Foo.new('foo', 'bar') ERB.new('<%= foo %> and <%= bar %>').result(foo.instance_eval{binding}) # => \"#<struct Foo foo=\\\"foo\\\", bar=\\\"bar\\\"> and bar\" \u3053\u308c\u306ffoo\u304c\u3059\u3067\u306b\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3068\u3057\u3066\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b\u304b\u3089\u305d\u3063\u3061\u304c\u512a\u5148\u3055\u308c\u305f\u8a71\u3067\u3057\u3087\u3046\u3002 foo.instance_eval { foo } # => #<struct Foo foo=\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubikitch.hatenadiary.org%2Fentry%2F20080529%2F1212041433\" title=\"\u30e1\u30bd\u30c3\u30c9\u540d\u3068\u540c\u3058\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304c\u3042\u308b\u5834\u5408\u306f\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304c\u512a\u5148\u3055\u308c\u308b - http://rubikitch.com/\u306b\u79fb\u8ee2\u3057\u307e\u3057\u305f\" 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/rubikitch/","blog_title":"http://rubikitch.com/\u306b\u79fb\u8ee2\u3057\u307e\u3057\u305f","width":"100%","provider_name":"Hatena Blog","title":"\u30e1\u30bd\u30c3\u30c9\u540d\u3068\u540c\u3058\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304c\u3042\u308b\u5834\u5408\u306f\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304c\u512a\u5148\u3055\u308c\u308b","version":"1.0","image_url":null}