diff options
| author | Randy Morgan <[email protected]> | 2012-10-14 09:50:49 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-10-14 09:50:49 +0900 |
| commit | 797a1e5150fc617774fcb8ee2bcce3fddb7ab531 (patch) | |
| tree | 07d6e953abbb4afba309fb34d2833193358b045c /lib/axlsx/stylesheet | |
| parent | 87560296ccb05a4fb21461bc64aead272a5839b7 (diff) | |
| download | caxlsx-797a1e5150fc617774fcb8ee2bcce3fddb7ab531.tar.gz caxlsx-797a1e5150fc617774fcb8ee2bcce3fddb7ab531.zip | |
Refactored options parse into module and applied it to border_rb
This should be done for all classes that use this same peice of
repeated code.
Diffstat (limited to 'lib/axlsx/stylesheet')
| -rw-r--r-- | lib/axlsx/stylesheet/border_pr.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/axlsx/stylesheet/border_pr.rb b/lib/axlsx/stylesheet/border_pr.rb index eb1ecf4b..12b20d09 100644 --- a/lib/axlsx/stylesheet/border_pr.rb +++ b/lib/axlsx/stylesheet/border_pr.rb @@ -2,7 +2,7 @@ module Axlsx # A border part. class BorderPr - + include Axlsx::OptionsParser # @return [Color] The color of this border part. attr_reader :color @@ -45,9 +45,10 @@ module Axlsx # @option options [Symbol] style # @see Axlsx::Border def initialize(options={}) - options.each do |o| - self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" - end + parse_options(options) + #options.each do |o| + # self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + #end end # @see name |
