summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/num_data.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-10-14 11:34:51 +0900
committerRandy Morgan <[email protected]>2012-10-14 11:34:51 +0900
commita441bc1ff24c5b238203adb49b6e7ce208d5dabf (patch)
tree770da3a7384636a4cc0c35ff443d212a1ef47912 /lib/axlsx/drawing/num_data.rb
parente4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be (diff)
downloadcaxlsx-a441bc1ff24c5b238203adb49b6e7ce208d5dabf.tar.gz
caxlsx-a441bc1ff24c5b238203adb49b6e7ce208d5dabf.zip
Refactored to use use options parser.
Diffstat (limited to 'lib/axlsx/drawing/num_data.rb')
-rw-r--r--lib/axlsx/drawing/num_data.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/axlsx/drawing/num_data.rb b/lib/axlsx/drawing/num_data.rb
index ee6b145e..c1773f59 100644
--- a/lib/axlsx/drawing/num_data.rb
+++ b/lib/axlsx/drawing/num_data.rb
@@ -4,9 +4,7 @@ module Axlsx
#This class specifies data for a particular data point. It is used for both numCache and numLit object
class NumData
- # A string representing the format code to apply. For more information see see the SpreadsheetML numFmt element's (§18.8.30) formatCode attribute.
- # @return [String]
- attr_reader :format_code
+ include Axlsx::OptionsParser
# creates a new NumVal object
# @option options [String] formatCode
@@ -15,11 +13,13 @@ module Axlsx
def initialize(options={})
@format_code = "General"
@pt = SimpleTypedList.new NumVal
- options.each do |o|
- self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
- end
+ parse_options options
end
+ # A string representing the format code to apply. For more information see see the SpreadsheetML numFmt element's (§18.8.30) formatCode attribute.
+ # @return [String]
+ attr_reader :format_code
+
# Creates the val objects for this data set. I am not overly confident this is going to play nicely with time and data types.
# @param [Array] values An array of cells or values.
def data=(values=[])