Ruby (EVAL) - Selenium

ruby

#1

Hi Iam using page object model in my Selenium -Ruby Automation Framework and trying to use eval so that i can parameterize some value in the code and run them.

 on("abcpage").certify # code to click on button named certify using POM framework

so I want to parameterize the page value and button name with below code so tried eval but its now working.

not working :

 pagename = "abcPage"
 buttoname = "testbutton"
 eval(on(pagename).buttonname)

I tried only parameterizing the page name and give button name thats work but on giving both pagename and buttonname parameterized its not working.

eval(on(pagename).testbutton) 

Appreciate your help and suggestions to fix this issue.

Thanks.