I am looking for a way to get the type of a class variable with macros, but I couldn’t find the appropriate macro methods.
class Foo
class_property foo : String = ""
def self.foo_type
{{ @type.class_vars.find{|var| var.name == "foo"}.type }}
end
end
Foo.foo_type # => String
3 Likes
Thanks.