def set_format_properties(*properties)   # :nodoc:
    return if properties.empty?
    properties.each do |property|
      property.each do |key, value|
        # Strip leading "-" from Tk style properties e.g. "-color" => 'red'.
        key = key.sub(/^-/, '') if key.respond_to?(:to_str)

        # Create a sub to set the property.
        if value.respond_to?(:to_str) || !value.respond_to?(:+)
          s = "set_#{key}('#{value}')"
        else
          s = "set_#{key}(#{value})"
        end
        eval s
      end
    end
  end
def set_format_properties(*properties)   # :nodoc:
    return if properties.empty?
    properties.each do |property|
      property.each do |key, value|
        # Strip leading "-" from Tk style properties e.g. "-color" => 'red'.
        key = key.sub(/^-/, '') if key.respond_to?(:to_str)

        # Create a sub to set the property.
        if value.respond_to?(:to_str) || !value.respond_to?(:+)
          s = "set_#{key}('#{value}')"
        else
          s = "set_#{key}(#{value})"
        end
        eval s
      end
    end
  end
:call-seq:
    set_format_properties( :bold => 1 [, :color => 'red'..] )
    set_format_properties( font [, shade, ..])
    set_format_properties( :bold => 1, font, ...)
      *) font  = { :color => 'red', :bold => 1 }
         shade = { :bg_color => 'green', :pattern => 1 }

 Convert hashes of properties to method calls.

 The properties of an existing Format object can be also be set by means
 of set_format_properties():

     format = workbook.add_format
     format.set_format_properties(:bold => 1, :color => 'red');

 However, this method is here mainly for legacy reasons. It is preferable
 to set the properties in the format constructor:

     format = workbook.add_format(:bold => 1, :color => 'red');