Hi,
What you are encountering is an artifact of Ruby vs. JRuby.
We are using JRuby, which gives you Ruby-like access to any Java
method, ie you can access everything that's in the form getXYZ() as
just XYZ, although getXYZ and getXYZ() works as well. Hence the
magical "size" function instead of 'getSize'
The problem that you've encountered is that Ruby by default doesn't
call its equivalent of toString() on all objects when you print them.
BidEvent.getSize() returns you a BigDecimal - the right way to add a
.to_s at the end:
> puts "Bid Size" + bid.getSize.to_s
Otherwise, I get the following error:
15:24:48,831 WARN - Error executing RUBY Strategy
MarketData(metc:strategy:system:strategyMarketData3) in on_bid: can't
convert Java::JavaMath::BigDecimal into String :1:in `on_bid':1
Note that Ruby has another nifty feature that lets you access
variables directly from within a printed string using the #{varname}
semantics. In that case, it seems that it calls .to_s on the object
for you:
puts "Bid Size is #{bid.getSize}" or
puts "Bid Size #{bid.size}"
Hope this clarifies things a bit.
On Fri, Jan 2, 2009 at 2:59 PM, rivercode <
[hidden email]> wrote:
--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
_______________________________________________
m-etc-dev mailing list
[hidden email]
http://lists.marketcetera.org/mailman/listinfo/m-etc-dev_lists.marketcetera.org