class Chef::Resource::ChefClientConfig

Public Instance Methods

format_handler(handler_property) click to toggle source

Format the handler document in the way we want it presented in the client.rb file

@param [Hash] a handler property

@return [Array] Array of handler data

# File lib/chef/resource/chef_client_config.rb, line 306
def format_handler(handler_property)
  handler_data = []

  handler_property.each do |handler|
    handler_data << "#{handler["class"]}.new(#{handler["arguments"].join(",")})"
  end

  handler_data
end
string_to_symbol(prop_val) click to toggle source

@param [String, Symbol] prop_val the value from the property

@return [Symbol] The symbol form of the symbol-like string, string, or symbol value

# File lib/chef/resource/chef_client_config.rb, line 102
def string_to_symbol(prop_val)
  if prop_val.is_a?(String) && prop_val.start_with?(":")
    prop_val[1..-1].to_sym
  else
    prop_val.to_sym
  end
end