diff options
| author | Randy Morgan <[email protected]> | 2012-10-14 12:02:40 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-10-14 12:02:40 +0900 |
| commit | 5b5410845447772f4ba01b2ee5d03907f5897e7a (patch) | |
| tree | ce66d2add8423cf23b1c1a0bc35162c7447075ee /lib/axlsx/drawing/series.rb | |
| parent | a441bc1ff24c5b238203adb49b6e7ce208d5dabf (diff) | |
| download | caxlsx-5b5410845447772f4ba01b2ee5d03907f5897e7a.tar.gz caxlsx-5b5410845447772f4ba01b2ee5d03907f5897e7a.zip | |
Refactored to use options parser and serialized attributes
Diffstat (limited to 'lib/axlsx/drawing/series.rb')
| -rw-r--r-- | lib/axlsx/drawing/series.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/axlsx/drawing/series.rb b/lib/axlsx/drawing/series.rb index 9a4de2d4..c9f467d5 100644 --- a/lib/axlsx/drawing/series.rb +++ b/lib/axlsx/drawing/series.rb @@ -6,6 +6,8 @@ module Axlsx # @see Chart#add_series class Series + include Axlsx::OptionsParser + # The chart that owns this series # @return [Chart] attr_reader :chart @@ -22,19 +24,15 @@ module Axlsx @order = nil self.chart = chart @chart.series << self - options.each do |o| - self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" - end + parse_options options end - # The index of this series in the chart's series. # @return [Integer] def index @chart.series.index(self) end - # The order of this series in the chart's series. By default the order is the index of the series. # @return [Integer] def order @@ -68,5 +66,4 @@ module Axlsx str << '</c:ser>' end end - end |
