{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fokazuki.hatenablog.com%2Fentry%2F20070105%2F1167990516\" title=\"\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u30a2\u30af\u30bb\u30b5\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3076 - \u304b\u305a\u304d\u306eBlog@hatena\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","blog_title":"\u304b\u305a\u304d\u306eBlog@hatena","height":"190","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/okazuki/","type":"rich","published":"2007-01-05 18:48:36","title":"\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u30a2\u30af\u30bb\u30b5\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3076","url":"https://okazuki.hatenablog.com/entry/20070105/1167990516","description":"\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3092\u52d5\u304b\u3059\u3068 class Hoge attr_accessor :val def set_val a val = a end end h = Hoge.new h.set_val 10 p h.val \u7d50\u679c\u306f nil\u306b\u306a\u308b\u3002 \u4ffa\u304c\u601d\u3063\u3066\u308b\u611f\u3058\u3060\u3068set_val\u30e1\u30bd\u30c3\u30c9\u5185\u3067val=\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u3066@val\u306b10\u304c\u5165\u3063\u3066\u3044\u308b\u3060\u3063\u305f\u3093\u3060\u3051\u3069\u306a\u3041\u3002 set_val\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u5927\u4e08\u592b def set_val a self.val = a end \u3068\u308a\u3042\u3048\u305a\u98ef\u306e\u6642\u9593\u3060\u304b\u3089\u5f8c\u3067\u8abf\u3079\u3088\u3063\u3068\u3002 - \u98ef\u5f8c\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3068\u89e3\u91c8\u3055\u308c\u3061\u3083\u3046\u306e\u304b\u3002 \u3058\u3083\u3041\u3057\u3083\u3041\u306a\u3044\u306a\u3002","author_name":"okazuki","blog_url":"https://okazuki.hatenablog.com/","width":"100%","image_url":null,"categories":["Ruby"]}