class Rtml::Test::SimulatorPostProcessors::Receipt < Rtml::Test::SimulatorPostProcessors::Base affects 'Rtml::Test::Simulator', 'simulator' entry_point :check_print_directive def check_print_directive if print = on_current_screen("print").first # We reconstruct it because changing its child 's will change the XML itself, which we don't want. print = Hpricot::XML(print.to_s).root ((print / "getvar") || []).each { |getvar| getvar.inner_html = variables.literal_value(variables[getvar['name']]) } parent.receipt << print.inner_html parent.process(true) end end end