{"title":"RubyVM::AbstractSyntaxTree \u3067 Node \u3092\u8fbf\u308b\u51e6\u7406\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u5b9f\u88c5\u3059\u308b","version":"1.0","url":"https://sinsoku.hatenablog.com/entry/2023/11/29/001614","blog_url":"https://sinsoku.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/sinsoku/","provider_url":"https://hatena.blog","published":"2023-11-29 00:16:14","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsinsoku.hatenablog.com%2Fentry%2F2023%2F11%2F29%2F001614\" title=\"RubyVM::AbstractSyntaxTree \u3067 Node \u3092\u8fbf\u308b\u51e6\u7406\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u5b9f\u88c5\u3059\u308b - \u30a2\u30b8\u30e3\u30a4\u30ebSE\u306e\u6182\u9b31\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","author_name":"sinsoku","description":"Ruby \u306e Enumerator \u3092\u4f7f\u3046\u3068\u7c21\u5358\u306bRuby\u306e\u30b3\u30fc\u30c9\u3092\u51e6\u7406\u3067\u304d\u3066\u4fbf\u5229\u3060\u3063\u305f\u306e\u3067\u3001\u30d6\u30ed\u30b0\u306b\u66f8\u3044\u3066\u304a\u304f\u3002 ast = RubyVM::AbstractSyntaxTree.parse(<<~RUBY) class User < ApplicationRecord def say(text) puts text end def sum(x, y) x + y end end RUBY enum = Enumerator.new { |y| nodes = ast.children until nodes.empty? nodes.select! { _1.is_a?(RubyVM::A\u2026","provider_name":"Hatena Blog","categories":["ruby"],"height":"190","blog_title":"\u30a2\u30b8\u30e3\u30a4\u30ebSE\u306e\u6182\u9b31","type":"rich","image_url":null}