zdavatz/spreadsheet — pull request #69 by gguerrero (2013-11-12 11:41:39+00:00)
Title: Ability to update format attributes

## Updating format without overriding it!

Sometimes you may need just add a few new formats to an already formatted cell, so with ```update_format``` you'll be able to pass a simple hash with new attribute values and even initialise a non specific format on this cell using it's *default* *format*.

```ruby
book = Spreadsheet::Workbook.new
sheet = book.create_worksheet(name: "Sheet 1")

sheet.row(0).default_format = Spreadsheet::Format.new(name: 'Calibri', size: 11)
sheet.row(1).default_format = Spreadsheet::Format.new(name: 'Calibri', size: 12)

sheet.row(0).set_format(1, Spreadsheet::Format.new(border: :thin))
sheet.row(0).update_format(0, number_format: "0.00%", border: :thin)
sheet.row(0).update_format(1, number_format: "0.00%")
sheet.row(1).update_format(0, number_format: "0.00%", border: :thin)
sheet.row(2).update_format(0, number_format: "0.00%", border: :thin)
```

In the example:
* All row 0 cells will have *Calibri* font family with 11pt size, except for the column 1 (that overrides the default format with ```set_format```call). Both, column 0 and 1 on that row, with have border and a percentage number format and the column 0 keeps the font specified as default.
* All row 1 cells will have *Calibri* font family with 12pt size. The column 0 on that row also will have border and a percentage number format.
* The column 0 on the row 2 also will have border and a percentage number format. No font family or size were specified here, so it'll use the default one setup by the opener document.

Maybe it could be a good point to just past a hash of attributes and values to the ```set_format```method too... Or even better, unify this two methods to never override default_formats.
If you like that, we can work on the unify too.