it’s about Ruby.
I’ve got a Box Object with attributes such as “panel1”, “panel2”, …, “panel5”.
Instead of calling Box.panel1, Box.panel2, … I want to call it like Box.method_call(“panel” + some_integer.to_s).
I’m sure there is a way like this, but how’s the correct way?
Yours,
Joern.
Given:
You could use eval:
Using send probably more preferred:
Hope that helps.