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/util/options_parser.rb | |
| 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/util/options_parser.rb')
| -rw-r--r-- | lib/axlsx/util/options_parser.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/axlsx/util/options_parser.rb b/lib/axlsx/util/options_parser.rb new file mode 100644 index 00000000..c4c43fa2 --- /dev/null +++ b/lib/axlsx/util/options_parser.rb @@ -0,0 +1,9 @@ +module Axlsx + module OptionsParser + def parse_options(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + end + end +end |
