Forum: Ruby-dev Ruby Extension - Issue with arguments received in method_missing()

9b1a56162496bd47293fccce1abbdb47?d=identicon&s=25 Aarti Mahajan (aartimahajan)
on 2013-08-23 15:09
Hi All,

We have implemented Ruby extension using CPP as described here
This Ruby extension works as UNO-Ruby Bridge which allows implementation
of Uno components using
However I encountered a corner case in the following scenario. I have a
uno struct (i.e Book) containing a member of the type UNO Sequence (i.e

1. When we use following approach to assign values to member,
it works:

setValue =
setValue.No = 1
setValue.Name = "ABC"
dataElements =
dataElements << 0x40 << 0x0 << 0x07 << 0x0 = dataElements

Following is the reason why above assignment works:
a. UNO-Ruby Bridge is built upon method_missing(). Whenever any new
construct is encountered in Ruby script, Ruby invokes method_missing()
by passing appropriate arguments to this method.
b. In above scenario, method_missing() gets parameter methodName as
"data=" and args as "dataElements". If methodName ends with a '=' (in
this case it does), value of args is assigned to methodName.

2. When we use following approach to assign values to member,
it gives unexpected result.[0] = 0x40[1] = 0x0[2] = 0x07[3] = 0x0

In this case, Ruby invokes method_missing(), however arguments to this
method_missing() are not getting populated correctly from Ruby.
In this case inside method_missing(), we get parameter methodName as
"data" and args as empty. Thus the assignment fails.

Our interest is to make above mentioned second approach work.

The implementation of method_missing() is very similar to the
runo_proxy_method_missing() in

Is there any way this can be achieved?
Any help/pointers are much appreciated.

Thanks & Regards,
This topic is locked and can not be replied to.