summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/content_type
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-26 13:20:57 +0900
committerRandy Morgan <[email protected]>2011-11-26 13:20:57 +0900
commit11303a4d6664d9a7ff7bc408035d2ab70378a375 (patch)
tree51c675ae3ab8cd6c1afd7087145261b1eb2ec54c /lib/axlsx/content_type
parent044afe5a35db42cefce4f18a0fecc3da90cab1b5 (diff)
downloadcaxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.tar.gz
caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.zip
adding in support for ruby 1.9.3
release version 1.0.9
Diffstat (limited to 'lib/axlsx/content_type')
-rw-r--r--lib/axlsx/content_type/default.rb11
-rw-r--r--lib/axlsx/content_type/override.rb15
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/axlsx/content_type/default.rb b/lib/axlsx/content_type/default.rb
index c82e5f7d..5c688568 100644
--- a/lib/axlsx/content_type/default.rb
+++ b/lib/axlsx/content_type/default.rb
@@ -4,10 +4,11 @@ module Axlsx
# The extension of the content type.
# @return [String]
- attr_accessor :Extension
+ attr_reader :Extension
- # @return [String] ContentType The type of content. TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, CORE_CT, CHART_CT, DRAWING_CT are allowed
- attr_accessor :ContentType
+ # The type of content.
+ # @return [String]
+ attr_reader :ContentType
#Creates a new Default object
# @option options [String] Extension
@@ -19,7 +20,11 @@ module Axlsx
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
end
end
+ # Sets the file extension for this content type.
def Extension=(v) Axlsx::validate_string v; @Extension = v end
+
+ # Sets the content type
+ # @see Axlsx#validate_content_type
def ContentType=(v) Axlsx::validate_content_type v; @ContentType = v end
# Serializes the object to xml
diff --git a/lib/axlsx/content_type/override.rb b/lib/axlsx/content_type/override.rb
index 4d1b008f..362e834b 100644
--- a/lib/axlsx/content_type/override.rb
+++ b/lib/axlsx/content_type/override.rb
@@ -2,11 +2,13 @@ module Axlsx
# An override content part. These parts are automatically created by for you based on the content of your package.
class Override
- # @return [String] ContentType The type of content. TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, CORE_CT, CHART_CT, DRAWING_CT are allowed
- attr_accessor :ContentType
+ # The type of content.
+ # @return [String]
+ attr_reader :ContentType
- # @return [String] PartName The name and location of the part.
- attr_accessor :PartName
+ # The name and location of the part.
+ # @return [String]
+ attr_reader :PartName
#Creates a new Override object
# @option options [String] PartName
@@ -18,7 +20,12 @@ module Axlsx
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
end
end
+
+ # The name and location of the part.
def PartName=(v) Axlsx::validate_string v; @PartName = v end
+
+ # The content type.
+ # @see Axlsx#validate_content_type
def ContentType=(v) Axlsx::validate_content_type v; @ContentType = v end
# Serializes the Override object to xml