Method: Puppet::Application::FaceBase#render

Defined in:
lib/puppet/application/face_base.rb

#render(result, args_and_options) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/puppet/application/face_base.rb', line 38

def render(result, args_and_options)
  hook = action.when_rendering(render_as.name)

  if hook
    # when defining when_rendering on your action you can optionally
    # include arguments and options
    if hook.arity > 1
      result = hook.call(result, *args_and_options)
    else
      result = hook.call(result)
    end
  end

  render_as.render(result)
end