summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-30 10:38:46 +0900
committerRandy Morgan <[email protected]>2012-09-30 10:38:46 +0900
commit0b545d70fbc0eb3506150541fb070a667299b3b6 (patch)
tree4f4641dbe87a147bda848b83e8a30930857e71d3 /lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
parenteec3a4a1e492576107e6178fe613474285f80192 (diff)
downloadcaxlsx-0b545d70fbc0eb3506150541fb070a667299b3b6.tar.gz
caxlsx-0b545d70fbc0eb3506150541fb070a667299b3b6.zip
Extracted String Attribute method generation.
Diffstat (limited to 'lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
index 5de0a6d2..42e99d08 100644
--- a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
@@ -24,6 +24,7 @@ module Axlsx
# String attributes for this object
STRING_ATTRIBUTES = %w(display location tooltip)
+ include StringAttributes
#Cell location of hyperlink on worksheet.
# @return [String]
@@ -44,24 +45,7 @@ module Axlsx
@ref = cell_reference
end
- # Dynamically create string attribute accessors
- STRING_ATTRIBUTES.each do |attr|
- class_eval %{
- # The #{attr} attribute reader
- # @return [String]
- attr_reader :#{attr}
-
- # The #{attr} writer
- # @param [String] value The value to assign to #{attr}
- # @return [String]
- def #{attr}=(value)
- Axlsx::validate_string(value)
- @#{attr}= value
- end
- }
- end
-
- # The relationship required by this hyperlink when the taget is :external
+ # The relationship required by this hyperlink when the taget is :external
# @return [Relationship]
def relationship
return unless @target == :external