Method: Puppet::Interface::Action#when_rendering
- Defined in:
- lib/puppet/interface/action.rb
#when_rendering(type) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/puppet/interface/action.rb', line 79 def when_rendering(type) unless type.is_a? Symbol raise ArgumentError, _("The rendering format must be a symbol, not %{class_name}") % { class_name: type.class.name } end # Do we have a rendering hook for this name? return @when_rendering[type].bind(@face) if @when_rendering.has_key? type # How about by another name? alt = type.to_s.sub(/^to_/, '').to_sym return @when_rendering[alt].bind(@face) if @when_rendering.has_key? alt # Guess not, nothing to run. nil end |