summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/col.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-10-14 12:25:09 +0900
committerRandy Morgan <[email protected]>2012-10-14 12:25:09 +0900
commit93b70a39999ac4d06e43e495f3fd283e9630d9d2 (patch)
treebb2846edfc328ff9143c548c2a25eab23b8c9179 /lib/axlsx/workbook/worksheet/col.rb
parent5b5410845447772f4ba01b2ee5d03907f5897e7a (diff)
downloadcaxlsx-93b70a39999ac4d06e43e495f3fd283e9630d9d2.tar.gz
caxlsx-93b70a39999ac4d06e43e495f3fd283e9630d9d2.zip
Refactored to use options parser and serialized attributes.
Diffstat (limited to 'lib/axlsx/workbook/worksheet/col.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/col.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb
index 6c9271a2..596531ab 100644
--- a/lib/axlsx/workbook/worksheet/col.rb
+++ b/lib/axlsx/workbook/worksheet/col.rb
@@ -4,6 +4,7 @@ module Axlsx
# The Col class defines column attributes for columns in sheets.
class Col
+ include Axlsx::OptionsParser
include Axlsx::SerializedAttributes
# Create a new Col objects
# @param min First column affected by this 'column info' record.
@@ -19,12 +20,11 @@ module Axlsx
Axlsx.validate_unsigned_int(min)
@min = min
@max = max
- options.each do |o|
- self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
- end
+ parse_options options
end
serializable_attributes :collapsed, :hidden, :outline_level, :phonetic, :style, :width, :min, :max
+
# First column affected by this 'column info' record.
# @return [Integer]
attr_reader :min
@@ -107,7 +107,6 @@ module Axlsx
@width = v
end
-
# updates the width for this col based on the cells autowidth and
# an optionally specified fixed width
# @param [Cell] cell The cell to use in updating this col's width