Class Ruote::Dollar::RubyContext
In: lib/ruote/svc/dollar_sub.rb
Parent: Ruote::BlankSlate

Dict uses this RubyContext class to evaluate ruby code. The method of this instance are directly visible to "${r:ruby_code}" ruby code.

Methods

d   engine_id   fe   fei   fexp   flow_expression   method_missing   new  

External Aliases

workitem -> wi

Attributes

workitem  [R] 

Public Class methods

Public Instance methods

This ‘d’ function can be called from inside ${r:…} notations.

  pdef = Ruote.process_definition do
    sequence do
      set 'f:toto' => 'person'
      echo "${r:d('f:toto')}"
    end
  end

will yield "person".

fe()

Alias for flow_expression

The FlowExpressionId of the expression for which the rendering/substitution is occurring.

fexp()

Alias for flow_expression

The FlowExpression for which the rendering/substitution is occurring.

Given a workitem with the field "newspaper" set to "NYT", "${r:newspaper}" will eval to "NYT".

If the field "cars" hold the value [ "bmw", "volkswagen" ], "${r:cars[0]}" will eval to "bmw".

Else the regular NoMethodError will be raised.

[Validate]