summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/border.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-03-23 00:48:42 +0900
committerRandy Morgan <[email protected]>2012-03-23 00:48:42 +0900
commit43d31eb7c4f04e3ddf3bf865d55e6ce8de7b7a69 (patch)
tree44b89d66539724341e95cfc29d6aa70c771d77ca /lib/axlsx/stylesheet/border.rb
parent6df8104a5b059497d7363d45118a5d1379c4db6a (diff)
downloadcaxlsx-43d31eb7c4f04e3ddf3bf865d55e6ce8de7b7a69.tar.gz
caxlsx-43d31eb7c4f04e3ddf3bf865d55e6ce8de7b7a69.zip
update add Styles#add_style to allow a simple hash to create a new border style
Diffstat (limited to 'lib/axlsx/stylesheet/border.rb')
-rw-r--r--lib/axlsx/stylesheet/border.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/axlsx/stylesheet/border.rb b/lib/axlsx/stylesheet/border.rb
index 534521e6..f3d329fa 100644
--- a/lib/axlsx/stylesheet/border.rb
+++ b/lib/axlsx/stylesheet/border.rb
@@ -21,13 +21,13 @@ module Axlsx
# @option options [Boolean] outline
# @example Making a border
# p = Axlsx::Package.new
- # red_border = Axlsx::Border.new
- # [:left, :right, :top, :bottom].each {|item| red_border.prs << Axlsx::BorderPr.new(:name => item, :style=>:thin, :color => Axlsx::Color.new(:rgb => "FFFF0000"))}
- # red_border = p.workbook.styles.borders << red_border
- # red_border = p.workbook.styles.add_style :border => red_border
+ # red_border = p.workbook.styles.add_style :border => {:style =>: thin, :color => "FFFF0000"}
# ws = p.workbook.add_worksheet
# ws.add_row [1,2,3], :style => red_border
# p.serialize('red_border.xlsx')
+ #
+ # @note The recommended way to manage borders is with Style#add_style
+ # @see Style#add_style
def initialize(options={})
@prs = SimpleTypedList.new BorderPr
options.each do |o|