Class: Rtml::Test::SimulatorPostProcessors::Receipt

Inherits:
Base
  • Object
show all
Defined in:
lib/rtml/test/simulator_post_processors/receipt.rb

Instance Method Summary collapse

Instance Method Details

#check_print_directiveObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/rtml/test/simulator_post_processors/receipt.rb', line 5

def check_print_directive
  if print = on_current_screen("print").first
    # We reconstruct it because changing its child <getvar>'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