Currently ruby-rbs crate generates AST definitions (in bindings.rs) through build.rs. This is standard way in Rust ecosystem, but using ERB templates would make more sense since we can share the implementation with the C version.
Reference: ruby/rbs#2826 (comment)
@soutaro is good for this but also understand it's not straightforward. We need some discussion.