# File lib/puppet/network/format_handler.rb, line 107 def convert_from(format, data) format_handler.protected_format(format).intern(self, data) end
# File lib/puppet/network/format_handler.rb, line 111 def convert_from_multiple(format, data) format_handler.protected_format(format).intern_multiple(self, data) end
# File lib/puppet/network/format_handler.rb, line 119 def default_format supported_formats[0] end
# File lib/puppet/network/format_handler.rb, line 103 def format_handler Puppet::Network::FormatHandler end
# File lib/puppet/network/format_handler.rb, line 115 def render_multiple(format, instances) format_handler.protected_format(format).render_multiple(instances) end
# File lib/puppet/network/format_handler.rb, line 123 def support_format?(name) Puppet::Network::FormatHandler.format(name).supported?(self) end
# File lib/puppet/network/format_handler.rb, line 127 def supported_formats result = format_handler.formats.collect { |f| format_handler.format(f) }.find_all { |f| f.supported?(self) }.collect { |f| f.name }.sort do |a, b| # It's an inverse sort -- higher weight formats go first. format_handler.format(b).weight <=> format_handler.format(a).weight end result = put_preferred_format_first(result) Puppet.debug "#{friendly_name} supports formats: #{result.map{ |f| f.to_s }.sort.join(' ')}; using #{result.first}" result end