diff options
| author | Randy Morgan <[email protected]> | 2011-11-26 13:20:57 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-26 13:20:57 +0900 |
| commit | 11303a4d6664d9a7ff7bc408035d2ab70378a375 (patch) | |
| tree | 51c675ae3ab8cd6c1afd7087145261b1eb2ec54c /lib/axlsx/stylesheet/border_pr.rb | |
| parent | 044afe5a35db42cefce4f18a0fecc3da90cab1b5 (diff) | |
| download | caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.tar.gz caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.zip | |
adding in support for ruby 1.9.3
release version 1.0.9
Diffstat (limited to 'lib/axlsx/stylesheet/border_pr.rb')
| -rw-r--r-- | lib/axlsx/stylesheet/border_pr.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/axlsx/stylesheet/border_pr.rb b/lib/axlsx/stylesheet/border_pr.rb index 63a1f9de..cdab5b13 100644 --- a/lib/axlsx/stylesheet/border_pr.rb +++ b/lib/axlsx/stylesheet/border_pr.rb @@ -3,7 +3,7 @@ module Axlsx class BorderPr # @return [Color] The color of this border part. - attr_accessor :color + attr_reader :color # @return [Symbol] The syle of this border part. # @note @@ -22,7 +22,7 @@ module Axlsx # :dashDotDot # :mediumDashDotDot # :slantDashDot - attr_accessor :style + attr_reader :style # @return [Symbol] The name of this border part # @note @@ -36,7 +36,7 @@ module Axlsx # :diagonal # :vertical # :horizontal - attr_accessor :name + attr_reader :name # Creates a new Border Part Object # @option options [Color] color @@ -49,15 +49,18 @@ module Axlsx end end + # @see name def name=(v) RestrictionValidator.validate "BorderPr.name", [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal], v; @name = v end + # @see color def color=(v) DataTypeValidator.validate(:color, Color, v); @color = v end + # @see style def style=(v) RestrictionValidator.validate "BorderPr.style", [:none, :thin, :medium, :dashed, :dotted, :thick, :double, :hair, :mediumDashed, :dashDot, :mediumDashDot, :dashDotDot, :mediumDashDotDot, :slantDashDot], v; @style = v end # Serializes the border part # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to. # @return [String] def to_xml(xml) - xml.send(@name, :style=>@style) { + xml.send(@name, :style => @style) { @color.to_xml(xml) if @color.is_a? Color } end |
