diff options
| author | Randy Morgan <[email protected]> | 2012-10-14 11:28:02 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-10-14 11:28:02 +0900 |
| commit | e4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be (patch) | |
| tree | 92b9ef6e6a0d0329428e4ce1679cea6a0eff90e9 /lib/axlsx/drawing/chart.rb | |
| parent | 9740fed4e0834c0fcdce8e07153b9b794525f37e (diff) | |
| download | caxlsx-e4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be.tar.gz caxlsx-e4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be.zip | |
Refactored to use options parser
Diffstat (limited to 'lib/axlsx/drawing/chart.rb')
| -rw-r--r-- | lib/axlsx/drawing/chart.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb index 8566b3f3..35e2089a 100644 --- a/lib/axlsx/drawing/chart.rb +++ b/lib/axlsx/drawing/chart.rb @@ -6,6 +6,7 @@ module Axlsx # @see README for examples class Chart + include Axlsx::OptionsParser # Creates a new chart object # @param [GraphicalFrame] frame The frame that holds this chart. # @option options [Cell, String] title @@ -21,9 +22,7 @@ module Axlsx @show_legend = true @series_type = Series @title = Title.new - options.each do |o| - self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" - end + parse_options options start_at(*options[:start_at]) if options[:start_at] end_at(*options[:end_at]) if options[:end_at] yield self if block_given? |
