diff options
| author | Randy Morgan <[email protected]> | 2012-10-14 10:38:41 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-10-14 10:38:41 +0900 |
| commit | ddbed161e7b0c988f7ded5f6123cac6d991186dc (patch) | |
| tree | 17483b864961fe2c6b462ae9526810f5f7c32f85 /lib/axlsx/stylesheet/dxf.rb | |
| parent | 68ad81c68c4a802ec5432fd7b8aeb8767641ac92 (diff) | |
| download | caxlsx-ddbed161e7b0c988f7ded5f6123cac6d991186dc.tar.gz caxlsx-ddbed161e7b0c988f7ded5f6123cac6d991186dc.zip | |
refactor options parsing for dxf
Diffstat (limited to 'lib/axlsx/stylesheet/dxf.rb')
| -rw-r--r-- | lib/axlsx/stylesheet/dxf.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/axlsx/stylesheet/dxf.rb b/lib/axlsx/stylesheet/dxf.rb index 1a90d6b2..758b0869 100644 --- a/lib/axlsx/stylesheet/dxf.rb +++ b/lib/axlsx/stylesheet/dxf.rb @@ -3,6 +3,9 @@ module Axlsx # The Dxf class defines an incremental formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style # @see Styles#add_style class Dxf + + include Axlsx::OptionsParser + # The order in which the child elements is put in the XML seems to # be important for Excel CHILD_ELEMENTS = [:font, :numFmt, :fill, :alignment, :border, :protection] @@ -42,10 +45,7 @@ module Axlsx # @option options [CellAlignment] alignment # @option options [CellProtection] protection def initialize(options={}) - options.each do |o| - next if o[1].nil? - self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" - end + parse_options options end # @see Dxf#alignment |
