{"title":"Ruby\u306esetter\u306e\u8fd4\u308a\u5024","version":"1.0","blog_title":"tanaken\u2019s blog","author_name":"tanaken0515","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanaken0515.hatenablog.com%2Fentry%2F2023%2F02%2F28%2F233219\" title=\"Ruby\u306esetter\u306e\u8fd4\u308a\u5024 - tanaken\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>","provider_url":"https://hatena.blog","width":"100%","provider_name":"Hatena Blog","published":"2023-02-28 23:32:19","url":"https://tanaken0515.hatenablog.com/entry/2023/02/28/233219","height":"190","blog_url":"https://tanaken0515.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/tanaken0515/","type":"rich","description":"Ruby\u306esetter\u3068\u306f \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u5024\u3092\u4ee3\u5165\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u540d\u304b\u3089\u300c@\u300d\u3092\u524a\u9664\u3057\u3001\u672b\u5c3e\u306b\u300c=\u300d\u3092\u4ed8\u3051\u305f\u30e1\u30bd\u30c3\u30c9\u540d\u3068\u3059\u308b\u7fd2\u6163\u304c\u3042\u308b\u3002 Ruby\u7528\u8a9e\u96c6 (Ruby 3.2 \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb) \u3088\u308a\u5f15\u7528 \u4f8b\u3048\u3070\u3053\u3046\u3044\u3046\u30af\u30e9\u30b9\u304c\u3042\u3063\u305f\u5834\u5408\u3001 class Foo def x=(val) @x = val end end \u3053\u3046\u3044\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3088\u306d\u3002 irb(main):001:1* class Foo irb(main):002:2* def x=(val) irb(main):003:2* @x = val irb(main):004:1* end i\u2026","categories":["Ruby","\u5099\u5fd8\u9332"]}