On Fri, Jun 11, 2010 at 01:21:03PM -0700, Oleg wrote:
>
> I'm trying to figure out how to do dollar substitutions where the
> variable is not on the top level of workitem['fields']. In particular,
> given a hash in workitem['fields'] I want to get at the value of a
> particular key in that hash.
>
> A simple example of what I'm trying to do is here:
> http://gist.github.com/434980
>
> Line 18 does not print anything.
>
> The actual use case involves if expressions - the value I want to test
> is in a hash much like foo_hash in the above example.
>
> Are such substitutions possible?
Hello Oleg,
sorry for the late reply, I was on the road.
Here is a way of doing it :
---8<---
pdef = Ruote.process_definition do
sequence do
set :field => 'f', :val => { 'name' => 'toto', 'address' => %w[ KL Asia ]}
echo 'a${f:missing}'
echo 'b${f:f.name}'
echo 'c${f:f.address.1}'
end
end
--->8---
and another :
http://github.com/jmettraux/ruote/blob/ruote2.1/test/functional/ft_10_dollar.rb#L108-123
This ft_10_dollar.rb test file should contain all the possibilities.
By the way, I've been working on a solution to
http://github.com/jmettraux/ruote/issues#issue/11
Stay tuned.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en