{"categories":["Ruby"],"author_url":"https://blog.hatena.ne.jp/cevid_cpp/","width":"100%","image_url":null,"published":"2012-05-27 22:53:02","type":"rich","description":"\u306a\u3093\u3068\u306a\u30fc\u304f \u30af\u30e9\u30b9\u30de\u30af\u30ed\u3092\u7406\u89e3\u3057\u305f\u306e\u3067\u3001\u305d\u306e\u4ee3\u8868\u683c\u3067\u3042\u308battr_accessor \u3092\u81ea\u5206\u3067\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3002 1 class MyClass 2 p self # -> MyClass 3 def self.my_accessor name 4 p self #-> MyClass 5 define_method \"#{name}=\" do |v| 6 p self #-> # 7 @name = v 8 end 9 define_method \"#{name}\" do 10 @name 11 end 12 end 13 14 def test 15 p self #-> # 16 end 1\u2026","provider_url":"https://hatena.blog","version":"1.0","blog_title":"\u30dc\u30af\u30b3\u30b3","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbokukoko.hatenablog.com%2Fentry%2F20120527%2F1338126782\" title=\"\u30aa\u30ec\u30aa\u30ec attr_accessor - \u30dc\u30af\u30b3\u30b3\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://bokukoko.hatenablog.com/","title":"\u30aa\u30ec\u30aa\u30ec attr_accessor","url":"https://bokukoko.hatenablog.com/entry/20120527/1338126782","height":"190","author_name":"cevid_cpp","provider_name":"Hatena Blog"}