summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/defined_name.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/workbook/defined_name.rb
parent19649444434746507d01316a1095a31b155731ba (diff)
downloadcaxlsx-eec3a4a1e492576107e6178fe613474285f80192.tar.gz
caxlsx-eec3a4a1e492576107e6178fe613474285f80192.zip
Extracted boolean attribute class method generation to module.
Diffstat (limited to 'lib/axlsx/workbook/defined_name.rb')
-rw-r--r--lib/axlsx/workbook/defined_name.rb19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/axlsx/workbook/defined_name.rb b/lib/axlsx/workbook/defined_name.rb
index 10a84b3c..c8516afb 100644
--- a/lib/axlsx/workbook/defined_name.rb
+++ b/lib/axlsx/workbook/defined_name.rb
@@ -114,7 +114,7 @@ module Axlsx
# boolean attributes that will be added when this class is evaluated
BOOLEAN_ATTRIBUTES = [:workbook_parameter, :publish_to_server, :xlm, :vb_proceedure, :function, :hidden]
-
+ include BooleanAttributes
# Dynamically create string attribute accessors
STRING_ATTRIBUTES.each do |attr|
class_eval %{
@@ -132,23 +132,6 @@ module Axlsx
}
end
- # Dynamically create boolean attribute accessors
- BOOLEAN_ATTRIBUTES.each do |attr|
- class_eval %{
- # The #{attr} attribute reader
- # @return [Boolean]
- attr_reader :#{attr}
-
- # The #{attr} writer
- # @param [Boolean] value The value to assign to #{attr}
- # @return [Boolean]
- def #{attr}=(value)
- Axlsx::validate_boolean(value)
- @#{attr} = value
- end
- }
- end
-
attr_reader :name
# The name of this defined name. Please refer to the class documentation for more information
def name=(value)