BSalunke
BSalunke

Reputation: 11727

how to set the message attribute of the exception variable in Ruby?

I have an Exception type variable in Ruby. How can I set the value of attribute "message" of the exception variable? Is there any method to set the attribute (like rb_attr_set()..)?

Upvotes: 1

Views: 238

Answers (1)

BSalunke
BSalunke

Reputation: 11727

I got the answer for above question myself. We can set the "message" attribute of Exception object as follows:

rb_iv_set(*objeException, "mesg", current);

whereas current in VALUE type variable in which ruby string is stored..

Upvotes: 2

Related Questions