summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/styles.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-10-14 10:35:20 +0900
committerRandy Morgan <[email protected]>2012-10-14 10:35:20 +0900
commit30c2de9bd3b25bb4559f1dbb08ee7672f0ce5fd3 (patch)
treefc242e83e26d5c17250ab235292990057dee3a9e /lib/axlsx/stylesheet/styles.rb
parent12b25df5e477ce83fb9e8a82dd0510c912cddeaa (diff)
downloadcaxlsx-30c2de9bd3b25bb4559f1dbb08ee7672f0ce5fd3.tar.gz
caxlsx-30c2de9bd3b25bb4559f1dbb08ee7672f0ce5fd3.zip
patched border parsing for Style#add_style to enforce color and style options
Diffstat (limited to 'lib/axlsx/stylesheet/styles.rb')
-rw-r--r--lib/axlsx/stylesheet/styles.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index 240d86fa..da5b277f 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -316,7 +316,7 @@ module Axlsx
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.values_at(:style, :color).size == 2
+ 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|
b_options = { :name => edge, :style => b_opts[:style], :color => Color.new(:rgb => b_opts[:color]) }