def parse_border_options(options={})
      return unless options[:border]
      b_opts = options[:border]
      if b_opts.is_a?(Hash)
        raise ArgumentError, (ERR_INVALID_BORDER_OPTIONS % b_opts) unless b_opts.keys.include?(:style) && b_opts.keys.include?(:color)
        border = Border.new b_opts
        (b_opts[:edges] || [:left, :right, :top, :bottom]).each do |edge|
          edge_options = options["border_#{edge}".to_sym] || {}
          border_edge = b_opts.merge(edge_options)
          b_options = { :name => edge, :style => border_edge[:style], :color => Color.new(:rgb => border_edge[:color]) }
          border.prs << BorderPr.new(b_options)
        end
        options[:type] == :dxf ? border : borders << border
      elsif b_opts.is_a? Integer
        raise ArgumentError, (ERR_INVALID_BORDER_ID % b_opts) unless b_opts < borders.size
        if options[:type] == :dxf
          borders[b_opts].clone
        else
          border = b_opts
        end
      end
    end
def parse_border_options(options={})
      return unless options[:border]
      b_opts = options[:border]
      if b_opts.is_a?(Hash)
        raise ArgumentError, (ERR_INVALID_BORDER_OPTIONS % b_opts) unless b_opts.keys.include?(:style) && b_opts.keys.include?(:color)
        border = Border.new b_opts
        (b_opts[:edges] || [:left, :right, :top, :bottom]).each do |edge|
          edge_options = options["border_#{edge}".to_sym] || {}
          border_edge = b_opts.merge(edge_options)
          b_options = { :name => edge, :style => border_edge[:style], :color => Color.new(:rgb => border_edge[:color]) }
          border.prs << BorderPr.new(b_options)
        end
        options[:type] == :dxf ? border : borders << border
      elsif b_opts.is_a? Integer
        raise ArgumentError, (ERR_INVALID_BORDER_ID % b_opts) unless b_opts < borders.size
        if options[:type] == :dxf
          borders[b_opts].clone
        else
          border = b_opts
        end
      end
    end
parses Style#add_style options for borders.
 @note noop if :border is not specified in options
 @option options [Hash|Integer] A border style definition hash or the index of an existing border.
 Border style definition hashes must include :style and :color key-value entries and
 may include an :edges entry that references an array of symbols identifying which border edges
 you wish to apply the style or any other valid Border initializer options.
 If the :edges entity is not provided the style is applied to all edges of cells that reference this style.
 Also available :border_top, :border_right, :border_bottom and :border_left options with :style and/or :color
 key-value entries, which override :border values.
 @example
   #apply a thick red border to the top and bottom
   { :border => { :style => :thick, :color => "FFFF0000", :edges => [:top, :bottom] }
 @return [Border|Integer]