summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/d_lbls.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-30 10:32:54 +0900
committerRandy Morgan <[email protected]>2012-09-30 10:32:54 +0900
commiteec3a4a1e492576107e6178fe613474285f80192 (patch)
treeadd27b0ce160d54b87c4e3e4fbf2474278ad0a4c /lib/axlsx/drawing/d_lbls.rb
parent19649444434746507d01316a1095a31b155731ba (diff)
downloadcaxlsx-eec3a4a1e492576107e6178fe613474285f80192.tar.gz
caxlsx-eec3a4a1e492576107e6178fe613474285f80192.zip
Extracted boolean attribute class method generation to module.
Diffstat (limited to 'lib/axlsx/drawing/d_lbls.rb')
-rw-r--r--lib/axlsx/drawing/d_lbls.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb
index 531c5674..7dccf911 100644
--- a/lib/axlsx/drawing/d_lbls.rb
+++ b/lib/axlsx/drawing/d_lbls.rb
@@ -7,14 +7,6 @@ module Axlsx
# showLeaderLines and leaderLines are not currently implemented
class DLbls
- # These attributes are all boolean so I'm doing a bit of a hand
- # waving magic show to set up the attriubte accessors
- # @note
- # not all charts support all methods!
- # Bar3DChart and Line3DChart and ScatterChart do not support d_lbl_pos or show_leader_lines
- #
- BOOLEAN_ATTRIBUTES = [:show_legend_key, :show_val, :show_cat_name, :show_ser_name, :show_percent, :show_bubble_size, :show_leader_lines]
-
# creates a new DLbls object
def initialize(chart_type, options={})
raise ArgumentError, 'chart_type must inherit from Chart' unless chart_type.superclass == Chart
@@ -25,6 +17,15 @@ module Axlsx
end
end
+ # These attributes are all boolean so I'm doing a bit of a hand
+ # waving magic show to set up the attriubte accessors
+ # @note
+ # not all charts support all methods!
+ # Bar3DChart and Line3DChart and ScatterChart do not support d_lbl_pos or show_leader_lines
+ #
+ BOOLEAN_ATTRIBUTES = [:show_legend_key, :show_val, :show_cat_name, :show_ser_name, :show_percent, :show_bubble_size, :show_leader_lines]
+ include BooleanAttributes
+
# Initialize all the values to false as Excel requires them to
# explicitly be disabled or all will show.
def initialize_defaults