rbs
rbs copied to clipboard
RFC: new `Attribute#ivar` API
My proposal for fixing #2109. Feedback welcome!
I'm generally good for this. My suggestion is dropping location and comment.
I'm sorry for confusion. 🙇♂️
I think reusing the AST structure is good for this, while introducing a new class looks a bit too much.
Simply adding a new methods seem the best way:
-
instance_variable_name: Symbol | nil-- the new method! -
raw_instance_variable_name: Symbol | false | nil-- to avoid information loss -
ivar_name: Symbol | false | nil-- keep it for compatibility until rbs-4.0, which will be deprecated soon.