Ruby – alias of instance variables?

Is there a way to create an alias for an instance variable (not talking about the db alias attribute) instead of assigning it to another instance var?

For example:

@imavar

alias_attribute(@hesavar, @imavar)

you can use the getter method instead.

Is there a way to create an instance variable Alias ​​(not talking about the db alias attribute) instead of assigning it to another instance var?

For example:

@imavar

alias_attribute(@hesavar, @imavar)

You can use the getter method instead.

Leave a Comment

Your email address will not be published.