# File lib/ruote/util/dollar.rb, line 36
  def self.dosub (text, flow_expression, workitem)

    #
    # patch by Nick Petrella (2008/03/20)
    #

    if text.is_a?(String)

      Rufus.dsub(text, FlowDict.new(flow_expression, workitem))

    elsif text.is_a?(Array)

      text.collect { |e| dosub(e, flow_expression, workitem) }

    elsif text.is_a?(Hash)

      text.inject({}) do |h, (k, v)|

        h[dosub(k, flow_expression, workitem)] =
          dosub(v, flow_expression, workitem)
        h
      end

    else

      text
    end
  end